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