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
12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/homeland/site/sites_controller.rb', line 12 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
3 4 5 |
# File 'app/controllers/homeland/site/sites_controller.rb', line 3 def index @site_nodes = SiteNode.all.order(sort: :desc) end |