Class: BoardMessagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- BoardMessagesController
- Defined in:
- app/controllers/board_messages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/board_messages_controller.rb', line 8 def create @board_message = BoardMessage.new(params[:board_message]) if @board_message.save flash[:notice] = t('message_board.flashes.success_wait_moderation') redirect_to else @board_messages = BoardMessage.approved.paginate(:page => params[:page], :per_page => 12) render 'index' end end |
#index ⇒ Object
3 4 5 6 |
# File 'app/controllers/board_messages_controller.rb', line 3 def index @board_message = BoardMessage.new @board_messages = BoardMessage.approved.order('board_messages.date DESC').paginate(:page => params[:page], :per_page => 12) end |
#show ⇒ Object
19 20 21 |
# File 'app/controllers/board_messages_controller.rb', line 19 def show @board_message = BoardMessage.includes(:board_replies).find(params[:id]) end |