Thanks for the reply.  Like you pointed out, I have been 
misunderstanding that redirecting was due to 'new' action.  It's rather 
'create' action.

Right now I am trying to develop jQuery ajax that updates a part of the 
page.

So I tried in script controller,

  def create
    @script = Script.new(params[:script])
    respond_to do |format|
      if @script.save
        format.html { notice: 'Script was successfully added.' }
        format.js do
          render '/ajax/script_list'    #HERE!!!!!
        end
      else
        format.html { render action: "new" }
      end
    end

the following is the ':partial' that hopefully updates itself with ajax.

<%= form_for script, :remote => true do |f|%>
  <%= f.hidden_field :video_id %>
   ...
      <%= f.text_field :text, :class=>"xxlarge" %>
      <%= f.submit "save", :class=>"btn" %>
<% end %>

And of course, I need some JavaScript code that implements it.

Could anyone give some tips for that ?

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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to