Displaying 20 results from an estimated 7000 matches similar to: "undefined method `name'' for #<Category:0x3820f70>"
2006 Apr 29
1
undefined method `category_id''
3:
4: <b>Category: </b>
5: <select id="item_category_id" name="item[category_id]">
6: <%= options_from_collection_for_select @categories, "id",
"category", @product.category_id %>
7: </select>
8: </p>
9:
2006 Jan 07
2
help
I am at a lost with error below:
Extracted source (around line #15):
12: <p><b>Category:</b><br>
13:
14: <select name="product[category_id]">
15: <% @categories.each do |category| %>
16: <option value="<%= category.id %>"
17: <%= ''selected'' if category.id == @product.category_id
2006 Mar 01
1
question
Hello all!
I would like to get an admin interface for my shopping cart app
up and running using rails. The admin interface will be used for
Customers, Products, Catggories, ect management. My db schema reflects
the above mention tables names. The question I have is could I use the
scaffold feature this way:
(eg)---ruby script/generate scaffold Products Customers Categories
Admin?
2006 Jun 14
13
Undefined method
I really hope this is not a bad question (as in he''s abusing the
list). However I could use a little direction (even though I''m
reading books, tutorials)
Right now I''m getting a
undefined method `category'' for 4:Fixnum
The specific lines from the rhtml file are:
<td><%= link_to position.category_id.category, :action => "show", :id
=>
2006 Jan 06
3
Cookbook recipes eg - ordering categories in the recipe pull-down box
People,
I can order categories when looking at the categories list page but how
do I change the recipe page to list the categories in alpha order in the
recipe pull-down box?:
> <p><b>Category:</b><br>
> <select name="recipe[category_id]">
> <% @categories.each do |category| %>
> <option value="<%= category.id
2010 Mar 27
2
Shorter Rails 3 routes
Hi,
I have a small blog application, and I would like to shorten its routes.
Here they are:
Blog::Application.routes.draw do
resources :categories do
resources :articles do
resources :comments
end
end
A rake routes command produce the following lines:
GET
/categories/:category_id/articles/:article_id/comments(.:format)
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy,
I made this pager,
" def list
@item_pages = Paginator.new self, Item.count, 10, @params[''page'']
@items = Item.find :all, :conditions => "category_id =
#{params[:condition]}",
:limit => @item_pages.items_per_page,
:offset => @item_pages.current.offset
@categories = Category.find_all
2006 May 08
4
Rubyy on rails hosting
All,
Could any of you recommend an out fit for hosting my rails app that is
not expensive with excellent support. Thanks
Patrick
2006 May 08
2
Ruby on Rails hosting solutions
All,
Could any of you recommend an out fit for hosting my rails app that is
not expensive with excellent support. Thanks
Patrick
2006 Jan 03
4
validates_presence_of *_id attributes
Hi all,
I am a newbie to Rails. Please enlighten me on how to do this
appropriately, the Rails and the Ruby way:
Suppose I have a Recipe model. Let''s simplify things and pretend that
it has only 2 attributes, a :name and the other is a ''category_id''. In
the recipes table, category_id is a foreign key to field id of table
categories.
We also assume that I have generate
2009 Feb 21
3
belongs_to or has_many
2 tables Items and Categories
Categories (id, name)
Items (id, name, category_id)
Category_id can be null, and there are Categories that has not an Item.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email
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
2006 Jan 13
4
missing foreign key fields in scaffold views
Is there any reason that foreign key fields do not show in any of the
scaffold views ?
project table:
id serial primary key,
category_id integer,
user_id integer,
name varchar,
morestuff varchar
foreign key (category_id) references categories(id),
foreign key (user_id) references users(id)
scaffold generated views only show name, morestuff fields
2006 Aug 19
3
Special ruby language for describing sql conditions
I was brainstorming today about a smooth way to define conditions in an
sql query, when the numbers of attributes increase, so does the uglyness.
So instead of passing a hash, I thought you could specify the conditions
directly in code.
I hacked together some example code which actually turned out to work.
The result is concise and pretty beutiful.
def search(params)
Ad.find(:all) do
2008 Jun 10
5
Rails params parsing bug?
I have a form that sends the following query string to my Rails
controller:
transaxion[category_association_attributes][][category_id]=2&
transaxion[category_association_attributes][][amount]=12&
transaxion[category_association_attributes][][category_id]=1&
transaxion[category_association_attributes][][amount]=8
But ActionController parses it as:
2006 Aug 02
2
Ajax_Scaffold display from link table
Hi,
Ive followed the pets/people ajax_scaffold example without any problem.
I have a table documents and each document has a category. In the
documents table i have a field called category_id. So in the documents
grif i want to display the corresponding catgory name and when it comes
to adding a new category or editing the have a drop down list to select
from.
category.rb
require
2006 Jan 13
3
related drop down list / ajax
Hi all,
I''m trying to create a related dropdown box:
In my view:
<select name="category" id="category">
<option value="">Select category</option>
<% @categories.each do |category| %>
<option value="<%= category.id %>">
<%= category.title %>
</option>
<% end %>
2006 Jan 10
5
Select Tag and Associations
Hi there,
I''ve been working on this for awhile and have finally decided to ask
for a little guidance.I have a slight problem trying to save a
selection.
I have two models:
A "Posting" has_many "Categories", and a "Category" belongs_to one
"Posting". With that said, in the posting model I have "has_many
:categories" and within the
2006 Jun 05
5
adding habtm through migrations
Hello,
I''m stuck, I''ve got a model Product and would like to add a new model
called Category. Furthermore, I want to set up a many2many
relationship between the mentioned models. the problem is that I do
not know how to set the primary key in the categories_products table.
this is what I''ve got in my migration file:
create_table :categories do |t|
t.column :name,
2005 Apr 27
5
Eager load mysteriously deletes records
Hi
This looks like a bug in ActiveRecord.
I am messing with eager loading (on 12.1) and all of a sudden records
started disappearing from a table (and I am not doing anything delete
related)!!
The following line works OK:-
@todos = Todo.find(:all, :include => [ :whens],:order => "position ASC")
The following line is mysteriously deleteing :where rows from the DB
after