[Rails] Re: index page shown to have been accessed in logs after resource creation BUT the new entry page persists.
Here's what my parts_controller's create method looks like:
# POST /parts
# POST /parts.xml
def create
# Record current user's id as he/she created the part
params[:part][:created_by] = current_user.id
params[:part][:updated_by] = current_user.id
@part = Part.new(params[:part])
if @part.save
flash[:notice] = 'Part was successfully created.'
redirect_to( :action => 'index' )
else
format.html { render :action => "new" }
end
end
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home