Ruby on Rails Monday, April 11, 2016

I got it!!!

def show
@post = Post.find(params[:id])
@new_comment = Comment.build_from(@post, current_user.id, "")
respond_to do |format|
format.html {render :file => "posts/modal", layout: false}
format.js {render :file => "posts/modal", layout: false}
format.json {render json: @post }
end
end

--
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 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/4d8086a08f10ed9f83ad1c28c3c67d7a%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment