similar to: local variables in partials lead to NameError

Displaying 20 results from an estimated 4000 matches similar to: "local variables in partials lead to NameError"

2010 Jul 16
31
Added associations but don't see generated methods
Hi, I''ve got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_many :expenses; end
2009 May 27
9
Contingent Select Boxes - 2 Q's
I have a form with contingent select boxes (the state is contingent on the country selected, so when the country selected changes, the state changes -- I am using the Carmen plugin for getting my state names and country names together, but not the functionality I am interested in achieving). Everything works fine except I cannot figure out how to amend my code such that: A. When the form is first
2008 May 24
1
link_to_remote, image_tag, mouseover is this possible?
Hi guys, I was wondering if you are able to have a link_to_remote, having an image_tag and the link_to_remote has a mouseover event that updates a div. Does the image_tag need the mouseover event? I currently have: <%= link_to_remote(image_tag(@p_image.public_filename(:thumb)), :update => "big_pic", :onmouseover => {:action => :color_change, :id => @p_image.id})%>
2007 Dec 20
3
How-to spec this helper method?...
Hey gang, I have this dead-simple method defined in a helper: def add_category_link(name) link_to_function name do |page| page.insert_html :bottom, :categories, :partial => ''category'', :object => Category.new end end Where, and mostly how, would I spec this? I haven''t been able to find how to stub the rjs in a helper spec, so
2006 Apr 14
1
rake test errors
I have Rails 1.1.2, ruby 1.8.4 and gentoo linux running kernel 2.6.15. Here are the errors: gregg@gregg2 ~/user/DMS $ rake test (in /home/gregg/user/DMS) /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/ ordered_options.rb:2: warning: method redefined; discarding old []= /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/ ordered_options.rb:11: warning: method
2010 Jul 19
16
Strange Error undefined method `show' for # see no way to debug, suggestions?
I changed fairly much in my app without constant testing ( my bad ) now i get an error which I cannot seem to debug point my finger on. I have a home controller which just displays a welcome page this had a index only action. Whatever controller I try to open i always get above error message ActionView::TemplateError (undefined method `show'' for
2008 Apr 13
20
uninitialized constant
Hi guys, I''m part way through a RoR application, for some reason whenever I add new controllers (using scaffold) I get an uninitialized constant [name of controller] error. The first few controllers work fine, the only thing I can see that I''ve changed is the layout file (but scaffold creates a new layout for each controller so can''t see that being the problem). You
2009 Dec 24
4
NoMethodError
Hi, In a few words, can someone explain to me the NoMethodError. Googling for answers will get you to something but a direct answer from experts will give you something. NoMethodError in Book#new Showing app/views/book/new.html.erb where line #4 raised: undefined method `title'' for #<Book id: nil, created_at: nil, updated_at: nil> Extracted source (around line #4): 1:
2009 Sep 10
1
undefined method `protect_against_forgery?'
When I use plugin ''railstree'' (http://www.hashcode.eti.br/?p=91) as following code: node = Node.new :label => menu_item.name, :link_to_remote => { :base => self, :update => "container", :url => {
2011 Dec 05
9
jquery - word is not defined
Just starting out with a beginner book on jquery and the very first thing I am trying fails (has to be me) Rails 3.1 - other jquery things working including a poor example of drag & drop that is my ultimate target here but just simply trying to get every alternating row in a table to have a different css class So I''m using... app/assets/javascripts/people.js.coffee and put in...
2007 Dec 24
2
backgroundrb script crashing on startup
Everything works fine on my development box (Ubuntu 7.10, Ruby 1.8.6) but on my server (Fedora Core 6, Ruby 1.8.5) when I run script/backgroundrb start, the process fails to start. This is with Rails 2.0.2 frozen in the app, and I have the most recent version of the plugin (r297). Is Ruby 1.8.6 a requirement for backgroundrb now? I can''t figure any other reason it would fail...
2007 Sep 04
7
1.05 to 1.08
Hi We are looking at moving a project over from 1.05 to 1.08 but have a problem with some of our helper specs They work fine in 1.05 but error in 1.08 and it is the calls to route helper methods that seems to be the problem. I did some playing around .. because the code being tested is reasonably large etc ... but this sample (using the peepcode app) seems to boil down the problem
2008 Nov 12
4
Help! getting a "can't dup NilClass" error and don't know what to do about it.
Thanks for any help you can offer. I am trying to send out a small batch of emails using an http request. I know it sounds odd. hear me out. I have loaded a bunch of emails into this table and just want to slowly work through them. Sort of a poor mans AR:Mailer. But I am getting a "can''t dup NilClass" when I hit it with a http request. **********************************
2009 Jul 08
2
RuntimeError (JPEG marker not found!):
Hi, while generating the PDF file , i am getting following error.. please help for me. RuntimeError (JPEG marker not found!): C:/Ruby/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8/lib/pdf/writer/ graphics/imageinfo.rb:176:in ` measure_JPEG'' C:/Ruby/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8/lib/pdf/writer/ graphics/imageinfo.rb:174:in ` loop''
2006 Jun 07
2
How to send post data with link_to_remote?
Hi, I''m trying to send a post body with my link_to_remote call. Prototype supports the ''postBody'' option, but I can''t seem to get link_to_remote to set that. Here''s what I''m trying: link_to_remote ''move up'', :url => { :controller => ''upload'', :action => ''position_ajax'', :id
2009 Jan 20
5
Problem running rake test
I''m using the One-click 1.8.7rc2 Ruby Windows installer, everything has been working fine up till now, when i want to start getting into testing, i got this error, any reason why? C:/Ruby/bin/ruby -Ilib;test "C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/ lib/rake/rake_test_loader.rb" "test/unit/word_test.rb" C:/Ruby/lib/ruby/1.8/erb.rb:469:in `scan'': You have a
2006 Jul 20
6
Ruby on Rails & FastCGI 500 Error
I''m getting an error 500 and I''m at my wits end as to what could be causing it. I''m sure the path to the ruby executable is correct so what else could be causing it? -- Posted via http://www.ruby-forum.com/.
2013 Mar 24
5
Rails 4.0 has_many_through and fields_for
Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and nested attributes. class ControllerAction < ActiveRecord::Base has_many :interactions, dependent: :destroy has_many :roles, through: :interactions scope :controllers, lambda {|name| where("controller_name_id = ?", name)} scope :actions, lambda {|name| where("action_name_id =
2007 Dec 07
4
strange error on mock proxy
I''m banging my head over this really strange error in a view test when I run "rake spec". The weird thing is that I don''t get the error when I run the spec file by itself. Here is the spec (I know, fixtures are the devil): describe "/units/new.html.erb here" do fixtures :units, :accounts, :groups it_should_behave_like
2006 Apr 22
5
selenium plugin not working with rails 1.1
Hi, I really like selenium, and I just tried the plugin created Jonas Bengtsson. However I cannot get it to run on rails 1.1 and coundn''t find anyone complaining about it? Did anyone get it to run on rails 1.1.2? Greets, Abdur-Rahman