Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. the ruby source code generated by rails
  2. def show
  3.     @post = Post.find(params[:id])
  4.  
  5.     respond_to do |format|
  6.       format.html # show.html.erb
  7.       format.json { render json: @post }
  8.     end
  9.   end
  10.        
  11. format.html # show.html.erb
  12.       format.json { render json: @post }
  13.        
  14. format.json {
  15.     counter = counter + 1
  16.     render json: @post
  17. }