Hi,


i am working jquery+rails in view i sent data to contoller's
action and in that i action i tried to replace div with partial page
using following
def search_new
@manufact=Manufacturer.find_by_manufacturer_id(manf_id)
respond_to do |format|
format.html
format.js {
render(:update) {|page|
page << "$.("#search_new").html("<%=
escape_javascript(render(:partial => "search_new"))%>")"
}
}
end
end

but its not performing any action, could any one provide me solution ?

thanks,
-pab

--
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.

Search Discussions

  • Subbarao at Sep 19, 2011 at 1:38 pm

    On Monday 19 September 2011 06:29 PM, Pab wrote:
    Hi,


    i am working jquery+rails in view i sent data to contoller's
    action and in that i action i tried to replace div with partial page
    using following
    def search_new
    @manufact=Manufacturer.find_by_manufacturer_id(manf_id)
    respond_to do |format|
    format.html
    format.js {
    render(:update) {|page|
    page<< "$.("#search_new").html("<%=
    escape_javascript(render(:partial => "search_new"))%>")"
    }
    }
    end
    end

    but its not performing any action, could any one provide me solution ?

    thanks,
    -pab
    def search_new
    @manufact=Manufacturer.find_by_manufacturer_id(manf_id)

    respond_to do |format|
    format.js do
    render do |page|

    page.replace_html "search_new",:partial => "search_new "

    end
    end
    end
    end

    Try the above code.

    --
    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.
  • Tim Shaffer at Sep 19, 2011 at 1:47 pm
    replace_html is a Prototype helper and has been deprecated in Rails 3.1

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/TGE1y-zZsy0J.
    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.
  • Pab at Sep 19, 2011 at 1:53 pm
    Hi,


    replace_html is prototype method so it won't work, could u provide
    me any other solution that supports jquery ?

    thanks,
    -pab

    --
    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.
  • Tim Shaffer at Sep 19, 2011 at 1:59 pm
    First of all it looks like you have a syntax error in the JavaScript:

    $.("#search_new")

    should be

    $("#search_new")

    If that doesn't fix the issue, there still might be something else wrong.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ShOqoIrm4nMJ.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedSep 19, '11 at 1:00p
activeSep 19, '11 at 1:59p
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

3 users in discussion

Tim Shaffer: 2 posts Pab: 2 posts Subbarao: 1 post

People

Translate

site design / logo © 2021 Grokbase