similar to: Undefined method error

Displaying 20 results from an estimated 400 matches similar to: "Undefined method error"

2011 Nov 12
4
No route matches [GET] "/microposts/304"
Hi all, I''m learning Rails by Example (chapter 11), by Michael Hartl ( http://ruby.railstutorial.org/chapters/user-microposts#top) but I got no route matches when I try to delete one micropost. the _micropost html is... <tr> <td class="micropost"> <span class="content"><%= micropost.content %></span> <span
2011 Jul 22
9
Active Record Issue (I think)
I''m following a rails tutorial (Hartl) and it''s been fine so far, but something doesn''t seem to be working right. I have two basic models so far, "User" and "Micropost". class User < ActiveRecord::Base has_many :microposts end class Micropost < ActiveRecord::Base belongs_to :user end If I do something like: "first_user =
2011 Apr 15
7
warning: toplevel constant XYZ referenced Admin:XYZ
I have an odd problem. I got controllers in a namespace and controllers outside of the namespace. For example, I have a PagesController and a Admin::PagesController. When I run rspec from the top, tests pass and I get the following warning: spec/controllers/admin/pages_controller_spec.rb:4: warning: toplevel constant PagesController referenced by Admin::PagesController This makes no sense. I do
2009 Dec 02
14
root_path and root_url undefined
Hi all, I''ve just started working on another RoR project after a couple of months away. I''m having trouble with named routes, specifically root_* In previous apps I''ve used root_path and root_url without any problems, but in this project (2.3.2 - the same as my last project where I used it) it comes up undefined. I''ve double and triple checking my routes.rb,
2011 Jul 13
2
has many relationship
Can you change something in this kind of relationship, because it works great in previous version? NameError (uninitialized constant User::Post) class Post < ActiveRecord::Base belongs_to :user ... class User < ActiveRecord::Base has_many :posts accepts_nested_attributes_for :posts ... class PagesController < ApplicationController def index @user = User.find(6)
2012 Jul 17
24
Static Pages from Railcast
Hi everyone, I need several pages to be static but also modify when requested. I try following the railcast from Ryan at http://railscasts.com/episodes/117-semi-static-pages?view=comments Here what I have done!! rails g scaffold Pages name:string permanentlink:string title:string author:string access_level:string is_published:boolean meta_description:string meta_keyword:string
2010 Nov 12
1
Dashboard throwing undefined method `to_time' for nil:NilClass error on page view
Using 1.0.4 release on Solaris 10 with Ruby 1.8.7. Starting the server in production mode works fine until I request a page from the web browser then I get the following errors on the console. I''m running as user puppet (have also tried as user root but same output). All files are owned by user/group puppet/puppet. I have dropped and recreated the database multiple times just to see if
2008 Jan 10
2
Error on manual indexing
I''m having some problems with getting the drb server to work correctly on my production server. As a workaround I tried disabling automatic indexing and have a cron job manually update the index every hour or so. I disabled the automatic indexing with: def ferret_enabled? false end But whenever I try Page.rebuild_index I get a ''wrong number of arguments''
2013 Mar 02
3
Following railstutorial.org tutorial, how to make the microposts be seen by all?
I am a new learner of Ruby on Rails. I followed through the railstutorial.org tutorial and I''m trying to learn off the sample demo app where you can to make microposts and only the people who are "following" you can see them. If I wanted to make it so every user can see microposts as an additional functionality, what are the steps to do that? -- Posted via
2011 Jun 09
1
subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist
Hello, I''m doing namespace routing based on subdomain, rather than path, so that http://admin.example.com/pages leads to app/controllers/admin/ pages_controller.rb. Cucumber is following this fine, but RSpec is complaining that the requested route doesn''t exist even though "rake routes" shows the route. When I add a standard namespace below the "scope :admin"
2012 Apr 21
13
issues with changing directory structure in rails3
class BranchesController < ApplicationController def branch @branch = Branch.new (params[:branch]) branch_back = @branch.*branch* end end in the model have one *branch.rb* class Branch def branch end end In the view have one branches folder, also have the branch.html.erb in that folder. <%= form_for(@branch) do |f| %> <%end%> *routes.rb* * * match
2006 Jul 26
1
Scaffolding Problems
Hi.. Im a brand new ruby on rails developer, and when i make a scaffold and navigate to the it, i get an error that looks like this. ----------------------------------------------------------------- NameError in PagesController#list uninitialized constant Page RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace
2011 Sep 07
3
Method get of ActionController::TestCase ignores routes.rb?
Hi! I''m running into issue which seems to indicate that ActionController::TestCase.get() method ignores what I have in routes.rb. Happens in 3.0.10 and 3.1.0 too. I have the following RSpec2 test of my XmlRpcController#index action: it "should get nothing in response to GET request" do get :index response.response_code.should == 400 #bad_request end And the only line
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list, In the app we are making we have a rout something like this: map.resources :projects do |projects| projects.resources :pages, :controller =>"Wiki::Pages", :path_prefix => "/projects/:project_id/ wiki", :name_prefix => "project_wiki_" end But I can''t get RSpec(I''m very new to it) to accept this. It keeps throwing errors:
2012 Jun 12
0
setting up nulldb for fast tests
Hello everyone, I''m new to this group. Also I''m kind of new to rails too but I''m an experienced developer and kind of a coach for best principles, patterns and practices of effective software development/testing. I''ve developed few rails applications though and read almost fair amount of material for it. Currently I''m reading Avdi Grimm''s
2013 Mar 16
3
Do you ALWAYS use "bundle exec rspec spec" tests?
I''m going through Michael Hartl''s Rails tutorial, and I am happy to report that (as of the end of section 7) I''m able to get things working. (That said, I skipped the section on automated testing, as Hartl warned that automated testing is the most likely part of his book to become outdated.) There is a heavy emphasis on the "bundle exec rspec spec" tests.
2012 Jul 15
1
APP-ID for using Bing search api through "rbing" gem!
Hello all, I''m currently working on something and I need to use Bing search api in my rails app. I can user a gem called "rbing" which is a ruby wrapper around that api. For creating and instance of RBing class and using its methods I need to pass an APP-ID to its constructor like this -> bing = RBing.new("MYAPPID") for getting a Bing APP-ID I searched a lot and
2012 Nov 07
12
Develop using Rails in offline mode
I''m very new to Rails and I''m quite confused if I can practice Rails in offline mode? I''m following the Ruby on Rails Tutorail by Michael Hartl and I noticed that after generating a new app through the command "rails new app_name", "bundle install" is then called to download the gems specified in the Gemfile. What if I don''t have an
2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
I just switched from using the standard "id" column into using my own primary key and generating my own unique id for each record. But, this breaks acts_as_tree. Because my new primary key is not an integer, it breaks the SQL query as follows: StatementInvalid in PagesController#create --------------------------------------------------------------------------------------
2013 Aug 27
2
trying to create asset management app having trouble with edit page
i trying to create an asset management app. i am working through the ruby on rails 4.0 guide by Michael Hartl but in his guide it shows edit page for authenticated users i do not needthis function as the app will be deployed to an intranet. i have tried to adapt the edit portion in the above mentioned guide but it is not working. i am a newbie to this so any help with websites to look at or other