Displaying 20 results from an estimated 1000 matches similar to: "Problem with edge rails, controller namespaces and routes"
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 Mar 23
10
Domain Requirements in Routes (Edge Rails)
I saw on the bottom of the following page that you can route requests to
different controllers based upon which subdomain is being requested.
http://wiki.rubyonrails.com/rails/pages/Routes
with_options :requirements=>{:subdomain=>''first.com''} do
map.connect '''', :controller => "first/catalog"
map.connect ''featured'',
2007 Apr 09
2
Ferret Demo Problem
Dear,
I have download the demo of ferret from the following svn
svn://projects.jkraemer.net/acts_as_ferret/trunk/demo
and then i run the demo http://localhost:3005/content
but i got such exception:
undefined method `acts_as_ferret'' for ContentBase:Class
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
2007 Feb 07
3
Upgrade to Rails 1.2.2 : RESTful routes not working anymore
Hello,
I just upgraded my app to Rails 1.2.2.
My routes are :
map.with_options :path_prefix => "/admin", :name_prefix => "admin_" do |m|
m.resources :requests, :controller => "admin/requests", :collection => {
:destroy => :delete, :search => :post } do |request|
request.resources :histories, :path_prefix =>
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
2006 Sep 03
2
Fwd: Dealing with exec?
---------- Forwarded message ----------
From: Kevin Clark <kevin.clark at gmail.com>
Date: 01-Sep-2006 20:31
Subject: Dealing with exec?
To: James Mead <jamesmead44 at gmail.com>
Hey James,
Sorry to bug you. I was curious how you''d handle a call to exec in a
method you were testing. Kernel.stubs(:exec)... doesn''t seem to work
but I''m not sure where else an
2006 May 08
0
testing named routes
Hello,
I''m trying to test routes named within a map.with_options statement.
I have in routes.rb:
map.with_options :controller => ''films'' do |f|
f.overviews ''films/:index'', :action => ''index'', :requirements => { :index => /index(artist|date|title)\.html/ }, :index => ''new''
etc...
end
and
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
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 Dec 21
4
Stubbing Kernel#open
Anyone know how to stub Kernel#open? I''m trying to mock/stub an
open-uri call, but it doesn''t seem to like it.
Here''s the test code, and the failures:
body = File.open(File.dirname(__FILE__) +
''/../fixtures/google_search_california.html'').read
2006 Oct 17
1
nil object in live search
Hi,I am trying to implement a small live search thing in typo. the view
that I interative with is view/admin/content/_form.rhtml I created a
search field when creating an article and use observe_field to observe
this search field and tells the content_controller to search in database
for the appropriate match.
But when I tried to type a letter in the search field, I''ve got the
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
2006 Sep 03
1
Returning different values with stubs
Right now I''m working on adding tests to a method that looks like this:
def get_via_redirect(path, args={})
get path, args
follow_redirect! while redirect?
status
end
So, I want to confirm that get is called and that status is returned
but I also want to see that when the value of redirect? effects how
many times follow_redirect is called. Is there
2006 Sep 03
1
Slimmed down version for inclusion in Rails?
I''m pushing a major overhaul in testing the Rails codebase. Mocha and
stubba make my life easy so that''s what I''m using. The first major
patch using them is in RailTies
(http://dev.rubyonrails.org/ticket/5970) now. I spoke to DHH today
about using it in the other libraries and I think it''ll be ok, but
they really want to include as little code as needed. I
2006 May 24
2
named routes confusion
Hi,
I''m trying generate a URL from a named route like: namedroute_url(params...)
but the generated route is always coming out as the first match from the routes table.
The named route is defined inside a map.with_options block, but that shouldn''t matter should it?
dorian
--
--
I do things for love or money
2007 Jul 28
0
Problem with acts_as_ferret demo
Hi Jens,
I copied the demo folder into my rails apps and also created the
ferret_production and ferret_test databases.
when I start the server and type this in the browser:
localhost:3000/content
I get the following error:
NameError in ContentController#new
uninitialized constant Ferret::Search::BooleanClause
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
2006 Aug 18
0
Impact of inheriting controllers on models
I have some protected methods and authentication/acl filters I want to
inherit down through my controllers.
So I have controllers which inherit like this:
Application_controller
\
-- AdminArea Controller
--\
----dashboard controller
----user controller
----content controller
----\
------page controller
------placement controller
-- PublicArea Controller
--\
........
At the deepest level the
2006 Oct 07
3
blog_id magic with typo
Hi All,
I am modifying typo so as, I can host multiple blogs on the same typo.
And its almost done, except that...i am stuck at one place.
When a user posts a new article, depending upon current blog_id, I
would like to set the blog_id attribute of @article object.
So..in the admin/content_controller.rb:
We have:
def new_or_edit
if request.post?
set_article_author
2006 Apr 13
2
One model won''t work like the others, generating weird error
I''ve been banging my head against this for quite some time and can''t
figure out what is going on. I''m doing up a web site based on Typo and
adding in some custom controllers. I''m running Typo from trunk, so it''s
using the version of rails in vendor/rails. Everything is going
smoothly...until now.
I have one model that JUST. WON''T. WORK.
2007 Nov 07
0
Named routes raising nil.rewrite error
Hi all. I''m having a little problem with named routes. I have the
following named route:
map.with_options :controller => ''snippets'' do |map|
map.snippets
''faq/'', :action => ''index''
map.new_snippet ''faq/
new'', :action