Class: Rcms::MentionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Rcms::MentionsController
- Defined in:
- lib/generators/templates_mentions/app/controllers/rcms/mentions_controller.rb
Instance Method Summary collapse
Methods included from ApplicationController
Instance Method Details
#after_create_path(mention) ⇒ Object
18 19 20 |
# File 'lib/generators/templates_mentions/app/controllers/rcms/mentions_controller.rb', line 18 def after_create_path mention root_path end |
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/templates_mentions/app/controllers/rcms/mentions_controller.rb', line 7 def create @mention = Rcms::Mention.new mention_params @mention.is_published = true if @mention.save redirect_to after_create_path(@mention), flash: {success: t('rcms.mentions.created')} else render :create end end |
#index ⇒ Object
2 3 4 5 |
# File 'lib/generators/templates_mentions/app/controllers/rcms/mentions_controller.rb', line 2 def index @news = Rcms::News.all.page(params[:page]).per(10) title: t('rcms.mentions.index_title') end |