Displaying 20 results from an estimated 83 matches for "subcategori".
Did you mean:
subcategory
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 Subcategory a subclass of
Category. Am I right? Unfortunately, there''...
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to create a listing that contains subcategories! Even
th...
2006 Jul 23
3
Newbie: Display hierarchical Records in a view
Hi,
I have two models: category and subcategory. (one to many
relationship), and a controller ''home''
I''d like to display all the categories and their sub categories in the
view: home\index.rhtml.
I have a method in the ''home'' controller'' like this:
def list_categories
@categories = Category.find(:all)
end
This list all the categories
2006 May 07
2
Category and subcategories in database
...rails for. I''m new
to rails, so I''m not sure how easy it would be to implement something like
this using ActiveRecord. Here''s the situation:
Category > subcategory > subcategory > product
Category > subcategory > product
Some categories will have many subcategories, others few. I want to use
adjacency lists in the database like
ID CATEGORY PARENT
where top-level categories simply have no parent, but subcategories do. My
concern is whether Rails, using ActiveRecord, can be made to understand
this. I''m coming from PHP and know I can cod...
2006 Apr 11
2
Finding items from two models - then merging them
I have a model, listings. Listings habtm categories and subcategories,
which are seperate models.
What I want to do is search categories for certain items, like so:
@categories = Category.find(:all, :conditions => ["name LIKE ?",
"#%{:search_string}%"
and subcategories for the same:
@subcategories = Subcategory.find(:all, :conditions =&...
2009 Oct 15
10
AJAX - how to have multiple select form sets implemented?
...ng 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 blog on a restaurant review can belong to the following
categories & subcategories:
1) "food" -> "fine dining"
2) "people" -> "lifestyle"
3) "travelling" -> "restaurants"
After selecting a set of category...
2006 Jul 02
4
:order in partial
Hi,
i was looking through the docs and couldn''t find a good clean solution
for ordering a partial with an :order clause.
say i was iterating over categories and thier corresponding
sub-categories (regular belongs to) and wanted to order the
subcategories according to a certain column;
<% for category in @categories %>
<% render: partial => ''sublist'', :collection =>
category.subcategories, :order => ''position'' %> # position is a
column in my subcategories table
<% end %>...
2008 Apr 01
1
Navigation Problems
Hi,
I am having problems with my page. I have a banner and navigation bar in
controller_name.rhtml in app/views/layout. Can someone please help?
Thanks
In the navigation bar, I have the following links:
Category1
Sub-Category1
Sub-Category2
Sub-Category3
Sub-Category4
Sub-Category5
Sub-Category6
In the main content, I have the following links:
Sub-Category1 edit delete
2009 Mar 11
1
Reshape question.
This hopefully is trivial. I am trying to reshape the data using the reshape package.
First I read in the data:
a2009 <- read.csv("Total2009.dat", header = TRUE)
Then I trim it so that it only contains the columns that I have interested in:
m2009 <- melt(a2009, id.var=c("DayOfYear","Category","SubCategory","Sku"),
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
2006 Apr 07
13
Pop up menus - any ideas?
I''ve got a menu in which I have all of my categories as links. Each
category also has subcategories. I want to set it up so when you mouse
over the category the subcategories will pop up (to the right of the
main list, but that''s just CSS). This is what I have so far:
<% for category in @categories %>
<a href="#"
onmouseover="Element.show(''subcateg...
2006 Mar 31
7
Checkboxes expand to show new options when checked?
I''m writing a simple CMS where every item ("listing") HABTM categories
and subcategories (which themselves belong_to a category). What I''m
trying to do now is create a UI effect for listing creation: when you go
to create a listing, only the possible categories will be shown, but
when you select a category a set of new categories will be displayed
like so:
Lions
Tigers...
2008 Dec 25
5
One question about Dynamic Select Menus
...s/javascripts/dymanic_categories.js.erb where line #3
raised:
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
Extracted source (around line #3):
1: // javascripts/dynamic_categories.js.erb
2: var subcategories = new Array();
3: <% for subcategory in @subcategories -%>
4: categories.push(new Array(<%= category.id %>, ''<%=h
subcategory.subcategory_name %>'', <%= subcategory.id %>));
5: <% end -%>
Anyone got an idea, how does it happen?
--~--~---------~-...
2006 May 12
2
Has many through join table issues
...ugh
I think my models are a little more complex than what fits this
narrative.
I have a directory of members, each member can belong to multiple
categories.
The category table references itself to build a category list, joined
with parent_id. Top level categories will not have members, only
subcategories.
ie. Finance is top level (no member associated). Accountants, financial
advisors, investors will be subcategories (with lots of members).
I''m using a join table between members and categories to build the
associations between members and the category.
class MemberToCategory < Ac...
2006 Mar 29
0
Many-to-many relationship with multiple models?
I have a simple CMS I''m creating, and the primary model is the
"listing". A listing habtm (has_and_belongs_to_many) categories (up to
two) - allowing the listing to print its categories and a category to
print its listings. I also need subcategories, which are different from
categories in two ways: a listing can have as many subcategories (from
it''s two categories) as it wishes, and subcategories are displayed
differently in both administration and display views.
So what I have is:
Class Listing < ActiveRecord::Base
has_a...
2006 Apr 14
1
Model extends and belongs_to another model - problem
I have a model, categories, and another model, subcategories. In my
current code these have no connection except for the fact that
categories has_many subcategories and a subcategory belongs_to a
category. But by necessity, I need to change it so Subcategory extends
Category; so that I can search both models with one command.
I was hoping it would be...
2017 Aug 07
2
AliasAnalysis: may-alias subcategory
Hi,
The current AliasAnalysis marks may-alias for cases when memory passed as function argument.
i.e.
void foo(int *A, int *B, int *C) {
for (int i=0; i<N; i++)
A[i] = B[i] + C[i];
}
In the above example, it's may-alias for memory 'A', because 'A' is not known at 'foo' call sites.
Alias analysis is able to figure out memory 'A' is no-alias, if I
2005 Dec 21
0
Category/subcategory CRUD
Hello there! This is my first post! ;)
I''m starting on ruby on rails, so I have many doubts about it!
I''m trying to create a system that uses categories/subcategories.
I created a scaffold for a table that has the following fields:
- id int(11)
- name varchar(50)
- keyname varchar(50)
- visible enum(''0'',''1'') default ''0''
- pid int(11)
The rows are added as:
1, Articles, articles, 1, 0
2, Ruby on Rails, rub...
2006 Aug 06
1
Newbie: populate 2nd dropdown list based on user''s selection in 1st dropdown list
Hi,
I am creating a form that a user can post a message based on his
selection on category and subcategory. (A category has many
subcategories.)
How do I dynamically populate subcategory dropdown list when user
chooses a category from category dropdown list?
Thanks in advance.
--
Best regards,
Ming Ma
2017 Aug 07
3
AliasAnalysis: may-alias subcategory
There are function which does have optimization opportunities but because of may-alias memory dependencies sometimes optimization is not effective. May be runtime checks kills the gains of optimization. For such cases aiming to do interprocedural function specialization optimization where in the clone function version no-alias assumption can be assumed and the original function version will hold