search for: category_names

Displaying 20 results from an estimated 21 matches for "category_names".

Did you mean: category_name
2006 Jan 08
2
sorting issue
I''ve got the following setup: category (hm) <-> (bt) activity An activity has an amount, date, location, note, and category. I''m sorting my activities table by category_id (foreign key in activity), but how do I sort it by category_name instead? Basically I just need category_name in the result set. Here''s what I have now: @all = Activity.find(:all, :order
2006 Apr 21
6
How access to the tables whitout a model
i have a table called Products whit a model product, but in the view i need show the category od the product, but whitout a model of categories... -- Posted via http://www.ruby-forum.com/.
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2006 Jul 07
9
Search on data accross many tables, linked by belongs_to
I am using Ferret and acts_as_ferret, as my search back-end for my Rails project. I have a question about using acts_as_ferret on a main table that is linked to other tables by foreign keys. Is there a way to include the information linked by the belongs_to keyword in the search results ? As an example, let''s say I have a main table ''posts'':
2005 Jul 22
1
A Bit Baffled By text_field
Hello. I am converting my Java app to Rails and I''ve hit something that has me a bit baffled. I''ve been fiddling with this for over an hour and trying many different combinations so at this point I''ve lost perspective. It''s probably something simple but I can''t see it anymore. I have a component that looks like this: <% for advertiser_category in
2006 Feb 01
0
to_param() / url generation Question
I''m trying to implement the to_param method to allow url generation to be in the format of /:category_name/:article_permalink (as discussed on page 299 of Agile Web Development With Rails). I expect that I need to override/implement the to_param method and have it return the category_name for the category model and the article_permalink for my article model, but I haven''t
2010 May 13
1
Routing - newbie question about shorting the url
Hi Right now I have my url showing as the following: http://localhost/categories/italian/recipes/special-pasta-sauce I would like it to be: http://localhost/categories/italian/special-pasta-sauce (or even http://localhost/italian/special-pasta-sauce) my category model has_many :recipes and my recipes model belongs_to :category (for the purposes of my test project a recipe can only belong to one
2006 May 11
3
Find By ID
Hi folks, Newbie with ruby on rails but very excited by the features provided by the framework ;) Suppose I''ve got a table ''Company'' and a table ''Category'' Company belongs to a category but I will retrieve the Catagory in the Company list? It seems that I don''t have the basic ruby wau of thinking to get this easily. Can someone help?
2006 Jun 19
10
Trying to delete from a unordered list using ajax
I have a controller method as such: def delete @category = Category.find_by_name(params[:name]) @element_id = @category.name Category.delete_all(["name = ?", @category.name]) end (For the purpose of this exercise, category names are unique) I have the corresponding delete.rjs file: if @element_id page.remove :id => @element_id page.visual_effect :highlight,
2007 Nov 09
2
Problem with stemming and AAF
I''m sure I''m missing something completely obvious here, so I hope someone can point me in the right direction! I''ve implemented a basic search with AAF, which works as expected; I''m running a ferret drb server, and using will_paginate to page results. The code in my search_controller.rb: search_text = params[:query] || " " @products =
2007 Aug 06
4
acts_as_ferret cross model index not updating
Does anyone know how do you get acts_as_ferret to automagically update non-standard fields? I''ve followed Rails Envy''s tutorial (http://www.railsenvy.com/2007/2/19/acts-as-ferret-tutorial#nonmodel) to get aaf working across different models. And once the index is built it searches fine. In my (main) model, I''ve put: acts_as_ferret :fields => [ :name,
2006 Mar 12
11
HABTM selection conditions
Hi, I am currently trying to learn RoR and there is something I cannot figure out. I have two models: Article and Category, that are HABTM-linked. Everything works fine if I want to select all articles corresponding to a category, with something like @articles = @category.find(@params[:id]).articles However, I have a ''published'' field in my ''articles''
2006 Jan 02
6
Paginate with joins messing with id
Hi all, Best wishes for the new year! :'') I''m very new to Ruby and Rails, and I ran into a problem with the "paginate" function. When I use the following method to get a number of forum topics based on a category name passed via the URI: @topic_pages, @topics = paginate :topics, :joins => "INNER JOIN categories ON
2013 Nov 10
3
accepts_nested_attributes_for how, example
I have following tables with following models: users(id, role_id) *has_many :entries* categories(id, category_name) *has_many :entries* entries(id, category_id, user_id) *belongs_to :user, belongs_to :category, has_one :storage* storages(id, title, content, entry_id)* belongs_to :entry*, *has_one :vote* votes(id, count, storage_id) *belongs_to :storage* Now,
2006 Aug 11
1
Avoiding adding duplicates to has_many collection?
Since there''s no ''exists?'' method for a has_many collection, is there an easier way to avoid adding duplicates to a collection? (I assume obj.items << item would add duplicates if repeatedly called.) Right now I do: category = Category.find_or_create_by_name(category_name) directory.categories << [ category ] if directory.categories.find(:first,
2006 Apr 09
1
select helper question
Hi there, I try to develop a medical application using ruby on rails. There are many categories which can contain subcategories. I defined the model like this: class Category < ActiveRecord::Base has_and_belongs_to_many :notes belongs_to :parent_category, :class_name=>"Category", :foreign_key=>"category_id" has_many :sub_categories,
2007 Jul 30
0
Rails/MSSQL error
Hi, I have been encountering this error when I try to save text with japanese characters: DBI::DatabaseError: Execute OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server Line 1: Incorrect syntax near ''20070730''. HRESULT error code:0x80020009 Exception occurred.: INSERT INTO categories ([category_name], [updated_at], [created_by],
2006 Feb 07
0
scope problems testing a helper method that calls link_to()
We''ve been having problems writing functional tests for helper methods that rely on ActionView methods. Here''s a specific example. In application_helper.rb I''ve got a method called ''party_link()¨: def party_link(party) link_to party.full_name, { :controller => ''contacts'', :action =>
2006 Jan 02
3
Selecting conditionally from HABTM
Hello, I was wondering whether there is a nice Rubyesque way of selecting from a pair of HABTM models where one of them is inherited from another object. Here is the situation: I have a ''posts'' table from which ''replies'' and ''articles'' are inherited. Articles have_and_belong_to_many categories, but neither posts nor replies do (it just does
2018 Jan 03
4
DNS logging for TLD queries?
On 1/2/2018 2:50 AM, Denis Cardon wrote: > Hi LingPanda101, > > >>     Is it possible to filter DNS queries for specific TLD's using the >> internal logging system? My IPS/IDS alerts me when a suspicious TLD is >> being queried. However I'm only able to see the DC as the source.  >> Thanks. >> >> Ubuntu 14.04 Samba 4.7.3. > > First you