Displaying 4 results from an estimated 4 matches for "add_skill".
Did you mean:
add_skills
2006 Jun 21
0
how to save objects associated via has_many :through?
...k. Please correct me where I''m wrong.
# in some controller, assume a form is being passed in to fill out the
# Technician and Skill objects
def add_technician_with_skills
@technician = Technician.new(params[:technician])
@skills = Skills.new(params[:skill])
begin
@technician.add_skills(@skills)
@technician.save!
rescue => err
# error handling
end
# other processing
end
# in technician.rb model
def add_skills(skills)
begin
cert = Certification.new(:technician => self,
:skill => skills,...
2006 Jun 22
0
how to save objects in a has_many :through association?
...k. Please correct me where I''m wrong.
# in some controller, assume a form is being passed in to fill out the
# Technician and Skill objects
def add_technician_with_skills
@technician = Technician.new(params[:technician])
@skills = Skills.new(params[:skill])
begin
@technician.add_skills(@skills)
@technician.save!
rescue => err
# error handling
end
# other processing
end
# in technician.rb model
def add_skills(skills)
begin
cert = Certification.new(:technician => self,
:skill => skills,...
2006 Feb 27
6
One to Many example... please!
...t fk_skills_cv foreign key (cv_id) references cvs(id)
);
Now, I think the db is as it should be from what I have been able to
gleen from Agile..., 4 days... and OnLamp...
So now I have the view for the CV in place with a link to ''Add a Skill''
which goes;
<%= link_to "add_skill", :controller => "cv_admin", :action =>
"new_skill" , :id => cv.id %>
But what should I put in the Controller & skill model to;
a. Create the skill with an association to the CV?
b. Find the skills associated with the CV so I can display them?
Just a co...
2006 Mar 04
5
has_many and belongs_to example?
Hi!
If i have 2 tables i.e. product and images and product has_many images,
image belongs_to product - how to create _form.rhtml, new/create and
edit/update methods in product controller, so in a single form i can add
one product and MANY (let''s assume for now that this number is fixed)
images for this product?
Pleeeeease help me :)
--
Posted via http://www.ruby-forum.com/.