Class: Homeland::Site::SitesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Homeland::Site::SitesController
- Defined in:
- app/controllers/homeland/site/sites_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/homeland/site/sites_controller.rb', line 14 def create :create, ::Site @site = ::Site.new(site_params) @site.user_id = current_user.id if @site.save redirect_to(sites_path, notice: "提交成功。谢谢。") else render action: "new" end end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/homeland/site/sites_controller.rb', line 5 def index @site_nodes = SiteNode.all.order(sort: :desc) end |