Class: Areas::PostsController
- Inherits:
-
BaseController
- Object
- BaseController
- Areas::PostsController
- Defined in:
- app/controllers/areas/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 |
# File 'app/controllers/areas/posts_controller.rb', line 14 def create @post.save! redirect_to(area_path(@area), :notice => 'Your message has been successfully posted.') rescue ActiveRecord::RecordInvalid render :action => :new end |
#index ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/areas/posts_controller.rb', line 5 def index params[:search] ||= {} @search = @area.posts.order('created_at DESC').joins(:issue).where('sent_at IS NOT NULL').search(params[:search]) @posts = @search.paginate(:page => params[:page]) end |
#new ⇒ Object
11 12 |
# File 'app/controllers/areas/posts_controller.rb', line 11 def new end |