FailableActionOptions ---> params

0 views
Skip to first unread message

David Beckwith

unread,
Apr 24, 2008, 11:59:21 AM4/24/08
to resource_controller
Hello,
I'm trying to customize 'create' but r_c is giving me grief about
the 'params' hash. Is there something obvious that I should know
about the params hash in resource_controller?
Thanks!
David :)
(I'm trying to make attribute_fu and attachment_fu play together.)

class PostsController < ResourceController::Base

create do
@comment = Comment.new(:uploaded_date => params[:comment_file])
@service = CommentService.new(@object, @comment)
respond_to do |format|
if @service.save
flash[:notice] = 'post successfully saved.'
format.html {redirect_to object_url }
else
format.html {render :action => :new }
end # if
end # respond_to
end # create
end

In the browser: http://localhost:3001/posts, gives this:

NameError in PostsController#index

undefined local variable or method `params' for
#<ResourceController::FailableActionOptions:0x33ba490>
...
Application Trace | Framework Trace | Full Trace

app/controllers/posts_controller.rb:4
app/controllers/posts_controller.rb:3

Reply all
Reply to author
Forward
0 new messages