Rails.application.routes.draw do
devise_for :users
namespace :admin do
resources :jobs do
member do
post :publish
post :hide
end
end
end
resources :jobs do
resources :resumes
end
root 'jobs#index'
end
---------------------------------------
git branch -D 你要删除的分支名称
git checkout -b 你想取的分支名称
git checkout 你想要切换到的分支名称
建立新项目
直接初始化项目
rails _5.2.4_ new rails110
11/3
git checkout -b ch04
在这个分支
git checkout -b ch05
rails _5.2.4_ new rails201-1
111-1
<%= render_group_description(group) %>
git push heroku ch07:master
To https://git.heroku.com/still-springs-51892.git
! [remote rejected] ch07 -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/still-springs-51892.git'
rails _5.2.4_ new rails111-2
删除
def destroy
@group = Group.find(params[:id])
@group.destroy
flash[:alert] = "Group deleted"
redirect_to groups_path
end
编辑
def destroy
@group = Group.find(params[:id])
@group.destroy
flash[:alert] = "Group deleted"
redirect_to groups_path
end
<div class="col-md-12">
Rails111-3
rails _5.2.4_ new rails301
cd rails301-1
bundle install
6-2 建立文章的架构
git checkout -b ch05
* = 是指派。@groups = Group.all,把 Group.all 数值 指派给 @groups 的意思。
* == “等于”
* != “不等于”
执行 bundle install
(注意:每次修改完 Gemfile 都记得要command + s 保存 ,然后执行 bundle install)
Stack exchange
Pwd 目前位置路径
Mkdir 新建文件夹
Touch新建文档
Rm删除
git@github.com:422190416/job-listing.git
git@github.com:422190416/job-listing.git
git@github.com:422190416/job-listing.git
gh repo clone 422190416/job-listing
https://github.com/422190416/job-listing.git
touch app/views/common/_navbar.html.erb
➜ job-listing git:(step1) ✗ rails -v
Rails 5.0.7.2
➜ job-listing git:(step1) ✗ ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin19]
➜ job-listing git:(step1) ✗
---------------------------------------------
div / span 的不同
<div>是块级元素(块级元素可以包括内联元素或其他元素),块级元素在浏览器显示时,会自动提行(另起一行)
<span>是内联元素,内联元素不会自动另起一行
===============------------------