Quantcast
Channel: Kibet's Brain Leaks
Viewing all articles
Browse latest Browse all 10

Demystifying Rails Render

$
0
0
I have seen quite a number of rails programmers getting confused when they use render with :action. For instance your typical edit and update actions, def edit @post = Post.find(params[:id]) @tags = @post.tags respond_to do |format| format.html end end def update @post = Post.find(params[:id]) if @post.update_attributes(params[:post]) redirect_to(@post) else render :action => :edit end end You’d […]

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images