similar to: Impact of inheriting controllers on models

Displaying 20 results from an estimated 900 matches similar to: "Impact of inheriting controllers on models"

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"
2009 Apr 12
0
rails 2.3 nested forms with has_many through checkboxes
I was wondering if anyone knew of a way to combine the new nested forms in rails 2.3 with a has_many through relationship via checkboxes. Basically I have a page model, a page_category model and a category_items join table. Pages have many page categories through category items. The category_items table is polymorphic so i can use it for other models who need categories (maybe this is
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
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
2006 Feb 25
0
neverending i2/lighttpd problems
So after recompiling ruby a few times to get ssl and readline working, fighting with lighty for awhile, and learning a bit more about linux in the process, I think I''m really close to getting i2 up and running. However, when I try to access my wiki, I get either a blank page or an error 500 and the stack trace below gets sent to the log. If I can''t get this working soon
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 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)
2006 Aug 19
4
acts_as_ferret causing strange behaviour
I posted this issue as a bug on the acts_as_ferret trac (http://projects.jkraemer.net/acts_as_ferret/ticket/36) but need to get this working asap. so hopefully someone can point me in the right direction. To try and sum this up in better terms than I used in the original bug report, the problem I am experiencing seems to be related to the fact I am using inheritance in my controllers. I
2006 Apr 28
1
Full-text Search Options Redux
Hey all, I haven''t heard much on the list in a while re: ActiveSearch, Ferret, Hyper Estraier, etc. in a while. Has anyone successfully used ActiveSearch on tables with rows in the order of hundreds of thousands, if not millions? (in our case, each row containing anywhere from a paragraph of text to many pages) Here''s some background on our search efforts. A. Hyper
2014 Apr 04
0
Rspec not running properly
Hello everybody, Being a new user of RoR, i'm experiencing a problem using Rspec, it should end without errors but I still get this result: PS C:\RubyTools\rubygems-2.2.2\rails_projects\sample_app> rspec spec Called from: C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
2006 Nov 04
0
Question about named routes - getting "No url can be generated for the hash"
So I''ve decided to clean up the structure of my rails app and have been using named routes and storing certain controllers underneath other controllers where appropriate.. For example, I have an AdminController, as well as a ContentController. I decided to make ContentController a subclass of the AdminController, because the content management portion of the site is only accessible to
2006 Feb 17
7
Create and then show
I am attempting to redirect to the show method after creating a new object. So, for example, once a new post is created the user is presented with the new post in a show view. The problem is I can''t get the correct <at> post.id to send to the show method. Rails always returns 0 for this value. Here''s what I have so far: class ContentController < ApplicationController
2005 Dec 21
1
Active Search
Issue: I am trying to get a good quality search capability across our site. I ran across ActiveSearch (http://julik.textdriven.com/svn/tools/rails_plugins/simple_search/) which seems to be a better solution for us than SimpleSearch (and SearchGenerator) as it is more than just word based. However, I am unable to get the project built and being fairly new to Ruby / Rails I''m a little
2006 Aug 03
1
routeset mapper problem
hello, I installed a rails app on dreamhost, which I''m building based on the Comatose plugin, and it went smoothly for the first version. Now I uploaded a second version where I broke down the Comatose code into a regular rails app, which works alright locally, but can''t get routing to work the same as before on the server. I believe I double-checked all gotchas mentioned
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,
2012 Jul 18
3
Undefined method error
I have been working on a project based on Michael Hartl''s book Ruby on Rails Tutorial in order to try to teach myself Ruby on Rails. However, when it tries to render a form designed to allow a user to submit a small message, I get an error saying, "undefined method `model_name'' for NilClass:Class". It says the error is at line 1, which is "<%= form_for
2006 Jan 17
9
Setting layout template in .rhtml
I''ve a single controller - class ContentController < ApplicationController end in the app/views/content folder I have quite a few .rhtml files I need to be able to choose a different layout template to use in each of these .rhtml files. i''d like to be able to do something like (which doesn''t work..) <% layout ''layout1'' %> Any
2006 May 04
5
How to install Ferret to get the best performance
Hey all, After dabbling with ActiveSearch, we''re coming back around to take another look at Ferret. ActiveSearch slowed to a crawl after indexing about 20k documents, each 20 lines each. This time we may attempt to create multiple Ferret indexes (isolating each organization''s data individually), since we eventually could have upwards of 20k documents for some
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
Hi folks - Seeing a weird problem and would love some help. It''s documented in http://pastie.org/278310 to be more readable. In short, I have a caches_page "action", :if => {stuff} but the :if is never being called - the action is just caching every time. (If I put a debugger call in the :if block, it never stops.) If I replace caches_page with caches_action, the if
2013 Jan 07
4
JSON::ParserError in controller
Hi All I''m trying to build an application which requires to scrap information from a webpage. On trying to perform the action, I get an error while trying to convert the html data to JSON. Has anyone experienced this before and if so can you please tell me how to solve this problem ? Please see below for code snippet and error log. Thanks in advance Anush require