Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Last active December 11, 2015 08:49
Show Gist options
  • Save telagraphic/4575930 to your computer and use it in GitHub Desktop.
Save telagraphic/4575930 to your computer and use it in GitHub Desktop.
def new
@current_account = signed_in_user.accounts.find(params[:account_id])
@new_credit = Credit.new
@new_credit.account_id = @current_account.id
end
:account_id is an attribute of the credits resource, so why use it to find an account record, why not just :id?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment