Skip to content

Instantly share code, notes, and snippets.

@codespectator
Created August 31, 2012 22:06
Show Gist options
  • Save codespectator/3559798 to your computer and use it in GitHub Desktop.
Save codespectator/3559798 to your computer and use it in GitHub Desktop.

Revisions

  1. James MacLeod created this gist Aug 31, 2012.
    13 changes: 13 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # I have this in my routes

    scope ':account_ident' do
    resources :things
    end

    # this scope is only active when a user is logged in and if possible I would like to append the account_ident automatically rather than having to do this in all the views:

    link_to "A thing", thing_path(thing, :account_ident => current_account.account_number)

    # or

    form_for @thing, :uri => things_path(:account_ident => current_account.account_number) do #...