Ruby on Rails
Wednesday, June 14, 2017
On Wednesday, June 14, 2017 at 8:49:27 PM UTC-4, Walter Lee Davis wrote:
There's nothing dated about it. Using RJS (Remote JavaScript) rendering gives you the ability to render just the parts of the page you want to replace. With jQuery, you would still have to render the custom HTML that you want to inject into the page, but then you would use load() or replaceWith() to substitute it into the DOM. Now you have two problems.
Walter
> On Jun 14, 2017, at 7:54 PM, fugee ohu <fuge...@gmail.com> wrote:
>
> I wanna render to an element instead of redirecting so went back to my book Agile Web Development with Rails adding ajax it says to make my link remote: true and put a respond_to js in my controller and then use a js.erb file Is that a little dated I've been doing some jquery by including *.js files in assets/javascripts Can I render my views to the element using jquery instead of js.erb I notice rails doesn't generate any js.erb files by default Should I do as the book says or find a way to do it with jquery? thanks ia
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com .
> To post to this group, send email to rubyonra...@googlegroups.com .
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ .2a6923a4-e128-4b1f-be14- 6eed119e66df%40googlegroups. com
> For more options, visit https://groups.google.com/d/optout .
I'm setting up the users page, the page that other users visit to follow or like them so the page has posts each with a comment link like this
<%= link_to 'Comment', new_comment_path('comment[commentable_type]': 'Post', 'comment[commentable_id]': commentable.id), remote: true %>
Now I just want the comment form to render so what should I name the <div> and what should I pass to render please Thanks
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bb04e9c7-3b73-4034-bbfb-cb9fe55af8b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment