Sorry, I misunderstood. When it succeeds, I don't want the page to
change.
So, I changed it to
def create
@script = Script.new(params[:script])
respond_to do |format|
if @script.save
format.json { render json: @script, status: :created, location:
@script }
else
format.html { render action: "new" }
format.json { render json: @script.errors, status:
:unprocessable_entity }
end
end
end
But it doesnt do anything. Of course, data has not been changed at all.
Maybe
<%= form_for script, :remote => true do |f| %>
is affecting the failure case as well?
soichi
--
Posted via http://www.ruby-forum.com/.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.