Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
has_many, belongs, and others vinculations
3 Posts
has_many, belongs, and others vinculations

Hello, i'm new at ruby and ruby on rails, in one project i want to vincule some tables.

  • company (has_many :users)
  • users (use restful_authentication)
  • clients (vinculed with company)

the company is not used more than to vincule users to it, the users are used to login to administration page

so i need to vincule clients with companies, but, how can i do it without using a hidden field?

i mean, on clients controller -update/create- how can i pass "current_user.company_id" to include in these actions??

sorry for my poor english, and hope you understand wath i say (lol)

thanks for all.

Ok, this is solved, i just add on controller some code to catch company id

it's not quite all vinculations i know, even CV resume employees can tell you more

3 Posts
Login to add your message