search for: set_scope

Displaying 1 result from an estimated 1 matches for "set_scope".

2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers. class CommentsController < ApplicationController meantime_filter :set_scope before_filter :find_comment, :only => %w(show edit update destroy) def index @comments = Comment.find(:all) end def new @Comment = Comment.new end def create @comment = Comment.create!(params[:comment]) redirect_to comment_url(@comment) rescue ActiveRecord::Recor...