Radhames Brito wrote in post #950151:
>> No, absolutely not.  I am saying that dynamically generating JS by means
>> of ERb is a design problem.  Receiving a partial from an Ajax call is
>> fine.
>>
>>
> I would really like to see an example of how to pull a partial with ajax
> without js.erb or js.haml, in a easy way of course,

I've just been looking at your sample code on Github, and I see the 
(anti)pattern you're using.  What you want to do, it seems to me, is 
this.

1. Use an Ajax call to get a rendered partial (in HTML) from Rails.
2. Put that HTML into the DOM.

So, something like (with jQuery):
$.ajax({ url: "http://myrailsapp.com/some_partial";, success: function 
(data) { $('#destination_element').innerHTML = data })

This is, I believe, the proper way to do it.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

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