javascript - rails ajax to render form -
I have an "join" button on my page, when clicked, the user gets model In my
join.js.erb file like a follow button, I am partially interpreting after joining the user, as if to show partially the same way with a Forms where they can now comment on the model. Here it is visible.
* join.js.erb * $ ("# restaurant- & lt;% = @ restaurant.id%>"). Html ("& lt;% = escape_javascript render: partial = & gt; 'restaurant / joint_button' ,: local = & gt; {: restaurant = & gt; @restaurant}% & gt;"); $ ("# Restaurant comment form"). Html ("& lt;% = escape_javascript render: partial = & gt; restaurant / comments_form ',: local = & gt; {: restaurant = & gt; @restaurant}% & gt;"); The comment here is partial
& lt;% if current_user.voted_on? (Restaurant)% & gt; & Lt; div class = "section-cover section-cover-two" & gt; & Lt; h4 class = "text-muted text-center" style = "margin: 0 10px;" & Gt; Write a review & lt; / H4 & gt; & Lt;% = Render: Partial = & gt; "Comments / Forms" ,: Local = & gt; {: Comment = & gt; @ Comment}%> & Lt; / Div & gt; & Lt;% end% & gt; Hence the JS file is partially rendering, which is partially presenting with the local people.
Where the error I am getting is
Comments
Post a Comment