search for: users_id

Displaying 6 results from an estimated 6 matches for "users_id".

Did you mean: user_id
2006 Feb 18
4
verifying best practice
i have a Project model, which belongs_to :user when i add a project, the users_id is based on the session[:users_id]. to get the users_id into the projects table, i''m doing this: @project = Project.new(params[:project]) @project.users_id = session[:users_id] this is working, i''m just verifying this is the best way to do it.
2009 Jan 10
2
hidden_field_tag flattens my array for value
ERB: <%= hidden_field_tag(''users_ids'', @users.collect(&:id))%> OUTPUT: <input id="users_ids" name="users_ids" type="hidden" value="127101520242526273035394142555772737479838593101104117121127128132133136143149162169170177181184187190198200203205206223226227228235238245246250254...
2005 Dec 15
3
How to delete a record
...with ajax, first column the user who arent in the group, the second column those who are in the group. (is cooler than 2 oldschool selectlists ;) ) now i want to delete this record ex: (i want to remove the link between the user and the group, but wanna keem the user and group object group_id = 5 users_id = 10 User.connection.delete("DELETE * FROM groups_users WHERE group_id = " + group_id + " and user_id = " + users_id) Anyone can help me?
2006 Jan 31
4
has_one without inverse belongs_to
I have two models called entity and user. The entities table has a column called users_id that contains the user id of the user that created the entity. In entity I have... has_one :user ... as I want to be able to show the user who created the entity from the entity object. But this produces the following error... Mysql::Error: #42S22Unknown column ''users.entity_id'...
2005 Dec 14
0
how to get these records in has_and_belongs_to_many relation
hey, i my database i have users and groups, each user can get in different groups my db structure: table groups: id, name, basegroup, firm_id table users: id, firstname, lastname, email table groups_users: group_id, users_id my relation is a many to many: class Group < ActiveRecord::Base has_and_belongs_to_many :users end class User < ActiveRecord::Base has_and_belongs_to_many :groups end i want this http://wiki.script.aculo.us/scriptaculous/show/SortableListsDemo with ajax, first column the user who ar...
2006 Apr 16
6
still learning maintaining data with join tables
...o_many :users Class User has_and_belongs_to_many :roles Class RolesUsers has_and_belongs_to_many :roles has_and_belongs_to_many :users According to the logs...I''m good through here @roles_users = RolesUsers.find(:all, :conditions => ["user_id = ?", params[:users_id]] ) the next section of controller code is a problem... for entry in @roles_users do entry.destroy end ActiveRecord::StatementInvalid in LoginController#save_rights PGError: ERROR: relation "roles_users_users" does not exist I really expected the above to work so I am...