similar to: undefined method `each' for #<Usrecart:0x46d1678>

Displaying 20 results from an estimated 1100 matches similar to: "undefined method `each' for #<Usrecart:0x46d1678>"

2008 Apr 07
7
Saving attribute
Something is getting lost here. def create @home = Team.find_by_user_id(current_user.id) for player in @home.players player.update_attribute(:game_id, @game.id) end end def show @players = Player.find_all_by_game_id(params[:id]) end view <%= @players.size %> # mistakenly equals zero Played with the console and everything should be working fine...
2007 Jul 25
2
Crude delay?
Hello, What is meant by crude delay in PESQ quality testing? And what is its tolerant limit for good quality. rgds, Sharan
2013 Feb 13
2
Job
Do you want to work in a creative, collaborative environment with a company that is the next *Big Thing*? The company is offering generous compensation and optional pre IPO stock options. Please call for details at 703-599-2067 or email sharan-yDk44B+76Hmb//RfMd0BrnJDajo6xbYeFNOCUTQkUI4@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on
2006 Jan 30
1
how to get column_for_attribute?
Hi all, In the code below I don''t understand: 1. Why I have to prepend overriden method content_columns with "self." to get it working? 2. Why column_for_attribute method is not working (no such method?) even if SomeTable is subclass of ActiveRecord::Base which have public column_for_attribute method? > class SomeTable < ActiveRecord::Base > > def
2006 Apr 27
2
"for column in..." not picking up _id columns
My code executes fully: <% for column in ModelName.content_columns %> <th><%= column.human_name %></th> <% end %> but it does not pick up any columns in my model''s table that end in "_id". Is this by design? Is there a helper method that will reference the related tables? Or will I need to code the column titles and detail records by
2006 Aug 07
8
Syntax Problem
In an *.rhtml, why do I need to add <% for product in @products %> in order that I may call an <img class="list-image" src="<%= product.img_url %>"/>. Is there not another way to skip the "for product" line? I really dont want to include it. I tried @products = product but it does not work. Can anyone help shed light on this matter? -- Posted via
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
All, I have ordered AWDWR and am anxiously awaiting its arrival. In the meantime I still am playing with ROR using radrails. I have a few questions ... I create a table named customers with the following details: Field Type Null Key Default Extra id int(11) NO PRI auto_increment customer_name varchar(50) NO inbound_retention int(11) NO outbound_retention int(11) NO unix_admin_email
2007 Jul 25
2
RE: Crude delay?
This is regarding the speexdec.c of the latest beta2 version. After decoding a frame, for packet_no =1, a new_frame_size and frame_offset are calculated and the number of decoded bytes writting onto a file depends on them. Why are they calculated? What happens if i directly write all the 320 shorts I get after decodong onto a file? --sharan -----Original Message----- From: Jean-Marc Valin
2005 Dec 30
3
Too many columns for list.rhtml to display on one page
I''ve gone once through the Agile book and am now attempting my own rails app. I''ve created a table named ''volunteers'' with over 15 columns. The problem is the default list.rhtml that is created with the scaffold, shows all the columns. I only want to show 4 of them with the list view. Where would I start to only return a handfull of columns to the
2006 Feb 01
4
Where is the send() function?
Hi, in the tutorial "4 Days on Rails" the following code fragment is used: ,---- | <% for column in Category.content_columns %> | <td><%=h category.send(column.name) %></td> | <% end %> `---- Apparently, the send() function returns the column value by name, but where does this function comes from? Unfortunately, neither the tutorial nor the API
2006 Mar 14
4
What does the send() method do on a model object?
All, I did a scaffold for a model and I ended up with this code in list.rhtml: <% for column in TargetList.content_columns %> <td><%=h target_list.send(column.name) %></td> <% end %> Where is the "send" method and what does it do? I can''t find it on ActiveRecord::Base? I assume that it returns a value based on the column id but I
2006 Mar 22
3
Something wrong with content_columns
I have a database with a couple of tables. One table called spares has foreign keys in another called equipment. When I create a new record, it is added to the spares table however the list action does not show all the columns in the table. It only shows those columns that are not foreign keys. I am using the default action generated by scaffold for list. Why is that so? Do i need to re-write my
2008 Mar 15
9
Spaces in Ruby on Rails and how to avoid them!
Hi, I just started learning ruby on rails and I am having hard time with white spacing! Here is the piece of code that will not work: validates_format_of :image_url, :with => %r{\.(gif|jpg|png)$}i, :message => "must be a URL for a GIF, JPG or PNG image" and here is the piece of code that will work: validates_format_of :image_url, :with => %r{\.(gif|jpg|png)$}i, :message
2006 Jan 25
1
Rails day 2: where is my association?
I?m following along a few tutorials on the web and trying to implement my own example, but I must be missing something because I can?t get has_many or belongs_to to work like I expected. now I have watched all the videos and made a cookbook several times with different interfaces. what I''m looking for is *not* a code snippet to solve something (because I already have that),
2005 Sep 17
1
Export to Excel
I need to export some data to an Excel file and found a reference in the HowTo section of the Rails Wiki. Followed it to the letter: added "export" action to controller, copied export.rxml and changed in accordance to model. When I call the export action I keep getting "undefined method `content_columns'' for #<Employee". The ActiveRecord mention content_columns
2006 Jan 28
3
DRY conflict with "Updated at" "Created at" "Deleted at" in view
Hi all, Are there any helpers or so for listview routines that suppres the three above mentioned columns? I''m currently exploring something like the code below. But it feels like I''m doing Rails'' work. # just for test purposes <div id="debug"> <% for col in Product.columns.map %> <%= col.name %> - <%= col.type %><br/> <%
2005 Dec 31
7
Dynamic form? Not really!
Hi guru''s out there, Im happilly coding my first rails app, and all goes well. I find myself manually coding in a particular field all the time (company_id), that relates the contact to a company. The total coding of this form seems somewhat much. Could somebody tell me what Rails power I''m possibly missing and stuborn as I am trying to do myself? I was wondering if the
2006 Aug 07
3
character encoding in RoR
Hi, I''m a newcomer to Ruby and to Rails, and am having a problem with character encoding. Now, I know ruby doesn''t handle unicode...but, characters like ? (eacute) and ? (ccedil) are part of the iso-8859-1 charset, so it shouldn''t be a problem, right? But, for some reason, the string functions still seem to hang on those characters. As an example, in a brand new rails
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id'' I have a Model class like the following: class Article < ActiveRecord::Base set_primary_key "ARTICLE_ID" end however, using a link_to like the following (modified scaffolding), the link has no id value: <% for article in @articles %> <tr> <% for column in
2006 Feb 03
1
Only iterating over the middle content_columns?
Standard behavior for the list action is to use content_columns to get all the fields of a model and then do something with them. I''d like to ignore some of them and iteratre over the rest. For instance I may have A B C D ... X Y Z and I''d like to do something special with A and B and then Y and Z, but in the middle I''d definitely like a loop to say