Skip to content

Instantly share code, notes, and snippets.

@scottmagdalein
Created July 10, 2012 13:42
Show Gist options
  • Save scottmagdalein/3083320 to your computer and use it in GitHub Desktop.
Save scottmagdalein/3083320 to your computer and use it in GitHub Desktop.
setting position for application url (with ternary)
private
def set_position
if @current_company
@position = @current_company.positions.find(params[:position_id])
else
@position = Position.find(params[:position_id])
end
end
private
def set_position
@position = user_signed_in? ? @current_company.positions.find(params[:position_id]) : Position.find(params[:position_id])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment