Class: Homeland::Site::Admin::SiteNodesController
- Inherits:
-
Admin::ApplicationController
- Object
- Admin::ApplicationController
- Homeland::Site::Admin::SiteNodesController
- Defined in:
- app/controllers/homeland/site/admin/site_nodes_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 23 def create @site_node = SiteNode.new(site_node_params) if @site_node.save redirect_to(admin_site_nodes_path, notice: "Site node 创建成功。") else render action: "new" end end |
#destroy ⇒ Object
41 42 43 44 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 41 def destroy @site_node.destroy redirect_to(admin_site_nodes_path, notice: "删除成功。") end |
#edit ⇒ Object
20 21 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 20 def edit end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 9 def index @site_nodes = SiteNode.order(id: :desc).page(params[:page]) end |
#new ⇒ Object
16 17 18 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 16 def new @site_node = SiteNode.new end |
#show ⇒ Object
13 14 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 13 def show end |
#update ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/homeland/site/admin/site_nodes_controller.rb', line 33 def update if @site_node.update(site_node_params) redirect_to(admin_site_nodes_path, notice: "Site node 更新成功。") else render action: "edit" end end |