Advertisement
saasbook

ajax_show_action.rb

Aug 15th, 2013
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.30 KB | None | 0 0
  1. class MoviesController < ApplicationController
  2.   def show
  3.     id = params[:id] # retrieve movie ID from URI route
  4.     @movie = Movie.find(id) # look up movie by unique ID
  5.     render(:partial => 'movie', :object => @movie) if request.xhr?
  6.     # will render app/views/movies/show.<extension> by default
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement