Thanks a lot for the replies! I guess I kind of prefer the
before_filter method a little bit because then I don't have to
replicate the redirect_if_not_found logic in each restricted action.
Thanks again!
--~--~-~--~~~---~--~~
You received this message because you
Hi, I just have a "best practices" question. I'd like to block users
that don't own a particular resource from performing edit/update/
destroy actions on it. Here's how I currently do it:
## User has many resources, of different types
--- resource_controller.rb ---
before_filter :requ
Oooh, that clarified a few things. Thanks Andrew!
On Dec 18, 4:58 am, Andrew Porter wrote:
> Lisa Klein wrote:
> > book.user_id = @user.id
>
> > Is this the way it's supposed to be done? I know that it's preferred
> > to interact with dependent resour
I have a Book resource that belongs both to a User and to an Isbn.
What is the recommended way of building a new Book record in this type
of situation?
class Book < ActiveRecord::Base
belongs_to :user
belongs_to :isbn
end
Currently I'm doing the following:
@isbn = Isbn.find(...)
book = @isb
4 matches
Mail list logo