Re: [Rails] getting userID from session into newly created records

2014-10-20 Thread Brian Sammon
[I thought that I'd avoid the distraction of critiquing my app in general by only posting code relevant to my question, but whatever--there's good advice here from Jason] On Mon, 20 Oct 2014 13:58:29 -0400 Jason Fleetwood-Boldt wrote: > > I want all the tables, including the membership join tabl

Re: [Rails] getting userID from session into newly created records

2014-10-20 Thread Jason Fleetwood-Boldt
* Is the user logged in? Are you using devise gem? If so (recommend), you have access to the current user using the current_user controller variable (provided by devise). Using devise with a proper authentication system is the way to go. There are alternatives to devise too. More responses

[Rails] getting userID from session into newly created records

2014-10-20 Thread Brian Sammon
What's the current best practice for getting the userID from the sesson, and having it be part of every newly created/modified record? I have an app with a Club model and a People model, and a "membership" join table. class Club < ActiveRecord::Base has_many(:memberships) has_many