so i have read conflicting information about this, some seem to pull
it off, some say its impossible, but here is what i am trying to
i am using authlogic w/ lockdown, and when i create a new user, i want
to add an entry into the user_groups_users join table with the new
user id, and a group id i pass it. i have tried several variations,
but here is what i ended up with (edited down to only pertinent info).
class User < ActiveRecord::Base
class UserGroup < ActiveRecord::Base
@user = User.new(:user_group_ids => params[:group]) # gets
passed in from /users/new?group=1
@user.user_groups.build #i have tried with and without this.
with it, i get duplicate ID fields in my view
view form (haml)
- form_for @user do |f|
- f.fields_for :user_groups do |g|
= g.text_field :id
if i fill out all the required fields, the user fields are saved, but
no user_groups_users entry is made
if i sumbit the form with just the user_groups_user id, the field
dissapears, but in my params, i see
i admit, i am a r00bie, so maybe i am going about this entirely
wrong. but can anyone offer any input?