I’ve two models “Projects” and “Hardwares” that has a many to many relatioship between them. Those are codes for Hardwares and Projects models:
class Project < ActiveRecord::Base
has_and_belongs_to_many :hardwares
end
class Hardware < ActiveRecord::Base
has_and_belongs_to_many :projectes
end
I’ve done tests using rails console, but I’m new to Rails and I’ve difficulties with controller and view. My issues are the following: I need a simple view for Projects that allowed me to add hardwares to it and I don’t know in witch way I can do it 🙁
Anyone can help me or suggest basic examples sites that I can use?
Thank you
Here’s an example using
usersandlanguages. It has the migrations, views, models, and controller code.Also, this rails cast might be pretty helpful if you prefer video format:
And here are some additional links you may find helpful: