Displaying 3 results from an estimated 3 matches for "checkboxhabtm".
2006 Jan 15
2
new objects and new associations in same view
Hello All,
I generated scaffolding for my Users table and setup my additional
models with their associations. I want to be able to create a new user,
and its associated groups and privileges from the same view. My
relationships are as follows:
users:
has_and_belongs_to_many :groups
has_many :privileges
groups:
has_and_belongs_to_many :users
privileges:
belongs_to :user
Right
2006 Aug 18
1
join update seperation?
...d a page that just
shows habtm checkboxes for the join and the updates are occuring for the
join but I''m getting Access errors on the user table (which I should) .
how do I limit what RAILS wants to update to just the join table. I
thought this (http://wiki.rubyonrails.org/rails/pages/CheckboxHABTM)
would do it based on the last comment.
here''s my relevant parts
def joinupdate
@user = user.find(params[:user][:CodeMgmtUserId])
if !params[:user]
@user.groups.clear
else
if
@user.update_attribute(:group_ids,@params[''user''][''Code...
2006 Jul 11
4
checkboxes with a has_many :through relation
All,
I''m populating a view with checkboxes in a list. I want to be able to
assign to my has_many relationship using the post values of these
checkboxes. Essentially, I want to populate the relationship table
which will create the correct join values in my model.
Here is my check_box_tag code:
<%= check_box_tag("@current_job[target_list_ids][]",