search for: subcategory_ids

Displaying 5 results from an estimated 5 matches for "subcategory_ids".

Did you mean: subcategory_id
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
...%= category.id %> > <%= category.name %> </div <for subcategory in category.subcategories %> <div id="indented"> <input type="checkbox" id="<%= subcategory.id %>" name="subcategory_ids[]" value="<%= subcategory.id %> > <%= subcategory.name %> </div> <% end %> <% end %> This is the controller code for create: def create @listing = Listing.new(params[:listing]) @listing.categories = Category.f...
2006 Apr 15
8
Inheritance in Rails - I need some help
I''ve got a model, "category" and another model "subcategory." Each subcategory belongs_to a category, and a category has_many subcategories. What I need to do is set it up so that I can search Category and Subcategory with one .find call. So: Category.find(:all, <etc) will find categories and subcategories. Now, I believe this can be done by making
2009 Oct 15
10
AJAX - how to have multiple select form sets implemented?
hi, there :) Consider a blogging application whereby a user is trying to add a new blog. He/she has to select a category. Upon selecting a category from a drop down box, a new sub categories drop down box will be created (hence an AJAX call). Got this implemented and it''s ok. Now, let''s assume that a given blog can have multiple categories (and subcategories). For example, a
2006 May 23
7
has_and_belongs_to_many question
Hello, I am trying to make the "switchover" to programming my apps in Rails and have a question about database structure. In the past i would structure a many to many like this: categories ---------------------------------------------------- | id | name | ---------------------------------------------------- 1 Some Category 2 Another
2009 Apr 05
5
Use a value from a different model
Hello, I cannot find the issue and it drives me crazy :( let''s simplify. I have 2 models: saving and purchase_type a *saving* corresponds to a *purchase_type* e.g. new sourcing or renegotiation a saving has exactly one purchase_type and a purchase_type has many savings. when I try to display the list of savings and their purchase type (name, not Id), i get the dreaded "You have a