similar to: Undefined Method Error in View

Displaying 20 results from an estimated 7000 matches similar to: "Undefined Method Error in View"

2006 Aug 05
1
Viewer Problem
In a standard scaffold generator, the list.rhtml looks something like this ... <% for column in Book.content_columns %> <th><%= column.human_name %></th> <% end %> How can I modify this code so for each table column add my own name not the "human_name" generated code? -- Posted via http://www.ruby-forum.com/.
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 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 May 01
1
Show/Hide with AJAX
I''m trying to implement a show/hide details function. I have the show part done, but I''m not sure how to get it to hide. My app looks like this so far: View: <%= link_to_remote "Show/Hide", :update => "details", :url => { :action => "show", :id => leif } %> <p id="details"></p> Action: def show @leif =
2006 Dec 28
1
Default Scaffolding Gives Errors
This is the default scaffolding for list.rhtml: [code] <h1>Listing <%= @scaffold_plural_name %></h1> <table> <tr> <% for column in @scaffold_class.content_columns %> <th><%= column.human_name %></th> <% end %> </tr> <% for entry in instance_variable_get("@#{@scaffold_plural_name}") %> <tr> <% for
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 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables CREATE TABLE continents ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE countries ( id int(11) NOT NULL auto_increment, name varchar(255) NOT NULL, continent_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; I generate scaffolds for country and for
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
2005 Dec 27
3
myObject.send(column.name) from Agile Development book
I''m studying the Agile Development with Rails book. In the chapter that first sets up the depot application (page 68), there is this bit of code from a view: <% for product in @products %> <tr> <% for column in Product.content_columns %> <td><%=h product.send(column.name) %></td> <% end %> etc... I am trying to absorb both Ruby and
2006 Mar 05
2
Need help understanding Rails magic!
Hi, I''ve just been pleasantly surprised, again, by how much Rails does for me, but I am *really* surprised. Surprised as in "how the heck did that happen?" I''d really like to understand this and would appreciate any help. Big picture... the user is presented with a form that allows them to select one or more check boxes to record their allergies. The form uses the
2006 Jan 22
0
Get colum types in auto form
Hi all, I''m trying to build a routine that generates table rows with the appropriate field types (text_area and text_field for now), and filters out the ''created_at'' and ''deleted_at''. <% for column in Project.content_columns %> <tr class="ListLine<%= cycle("0","1") %>"> <td><%=
2006 Jan 28
0
Auto drop list: Create a form professional or easy?
Hi all, I''m searching for a method to dynamically build a form. ( false/true field in the DB should automatically be a droplist) If you use "_form.rhtml" it works easy, with only this code in your partial, but uses the extra file, and doesn''t feel profi and flexible. <%= start_form_tag :action => ''create_product'' %> <%= render
2008 Mar 12
3
undefined method `each' for #<Usrecart:0x46d1678>
I have the an error such as undefined method ''each'' pls can any one find the error from the code given below <center><%=@b%></center> <center><h2>WELCOME IN YOUR PROFILE</h2> <%@usercart=Usrecart.find_by_user_id(@b)%> <%if @usercart.blank?%> <br> <br> <br> <br> <h2>THERE IS NO
2007 Mar 22
2
method to display the result of find (..) in a view
I''ve been trying to write a method that effectively displays the result of a find() for say.. my Customer model. What i''ve come up with is this: 1. The controller My main controller first makes the query via the model class MainController < ApplicationController def index order =
2010 May 07
1
undefined method 'find_by_sql'
Why would I get an undefined method `find_by_sql'' for #Example: 0x981a4e4> for error when trying to use the find_by_sql method in my model? def init_dictionaries tables = find_by_sql( "SHOW TABLES FROM thesaurus" ) @@tables = tables.collect{ |t| t.Tables_in_thesaurus } end -- You received this message because you are subscribed to the Google Groups "Ruby
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
2006 Sep 23
8
acts_as_rateable plugin help!
Hello, I am having some trouble figuring out how to use the rateable plugin. i followed as close as the directions located at http://www.naffis.com/blog/articles/2006/08/31/rails-ajax-star-rating-system but i fail at working it. i am getting this error You have a nil object when you didn''t expect it! The error occured while evaluating nil.rating Extracted source (around line #1): 1:
2006 Jun 22
1
finding one db entry and how to display it in a view
Here is my controller: class BrowseController < ApplicationController def index @products = Product.find(:all) end def item @products = Product.find(:all, :conditions => "id = #{params[:id]}") end end --- the ''item'' method is bothering me, because I know I should be able to simply do: def item @product = Product.find(params[:id])
2007 Dec 17
3
not able to view the images after the upload
hi, i have this problem where in i''m able to upload the images using file_column to the server but i''m not able to view the images.i''m not able to see the images but then i''m able to view the image name when i click on my show action. can any one please help?? THIS IS MY LOG as to what happens when i do the image upload. Processing UploadController#create
2010 Aug 01
0
how to debug random domU reboot
Hi, I just noticed one of my XEN domU''s rebooting by itself. No one was logged in and it wasn''t under load, but just rebooted. It rebooted again about an hour or 2 later Is there any way to see why to see what caused this, either from domU, or dom0 ? /var/log/messages has no indicative reason, but here it is: Aug 1 18:47:06 venus shutdown[13758]: shutting down for system