bhauff
unread,Jun 17, 2008, 9:22:37 AM6/17/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
Hi,
I have a scenario where I need to pass additional parameters to the
controller when using the should_be_restful macro. For example, I
have a Roles controller that interacts with the Roles model and the
User model (restful_authentication). I need to pass in the
params[:user_id] for the User.find in the various actions of the Roles
controller. Shoulda tells me "ActiveRecord::RecordNotFound: Couldn't
find User without an ID". I have tried adding this parameter to the
resource.create.params and resource.update.params, as well as the test
classes setup method and individual contexts setup method and it never
gets passed through correctly. I have noticed that the additional
params are usually a part of the params[:role][:user_id] rather than
one level up in the params[:user_id] where you also find
params[:action], params[:id], and params[:controller].
I have searched around through the rdoc's without any luck, and I may
be trying to do more than should_be_restful is really meant to do.
Any help would be greatly appreciated.
Thanks,
Brandon Hauff