Created
September 7, 2011 05:14
-
-
Save mclosson/1199816 to your computer and use it in GitHub Desktop.
How to obtain the installable object from a polymorphic relationship
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InstallStepsController < ApplicationController | |
before_filter lambda { | |
if params[:release_id] | |
@installable = Release.includes(:product).find(params[:release_id]) | |
elsif params[:virtual_machine_id] | |
@installable = VirtualMachine.find(params[:virtual_machine_id]) | |
else | |
redirect_to root_url | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment