Displaying 20 results from an estimated 10000 matches similar to: "Named routes raising exception"
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 May 31
5
Sharing code between some controllers? Staying DRY
Hi,
I have four controllers: one for the store front and three for the
store admin. In each controller I have copied and pasted exactly the
same code. It is a method called redirect_to() to override Action
Controller''s redirect_to(). Copy and paste is bad. I can think of two
options but I don''t know how Rails will feel about them.
Option 1: Can I create an intermediate
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
2007 Jul 12
3
Agh, this is annoying. Why is this happening?
My problem:
Mock ''Task_1005'' received unexpected message :user_id= with (1)
No matter what I do to try to stub that out it will still fail out and give
me that message.
Here is my spec
describe TasksController, "handling POST /tasks" do
before(:each) do
@task = mock_model(Task, :to_param => "1", :save => true)
2006 Apr 21
1
Catch authentication result from a model in a controller
Im still following the authorization recipe from the book, now all works
fine but im getting trouble in how handle the model authorization
result, if the user and pass are correct, it goes to a welcome
screen(admin.rhtml) but if wrong the model prints a message in an ugly
exception like page "usr and pass not correct", i want to redirect the
user to the login
2007 Oct 16
2
Named routes in controller not working?
I have some "redirect_to"s using named routes in a controller that work
fine in the browser, but choke my tests. The route in question is
"new_session" and comes from a "map.resource :session, :controller =>
:session" route mapping. If I replace the named route in the controller
with controller/action the tests run just fine, but for some reason it
doesn''t
2008 Jan 17
0
It seems to be a restful_authentication bug (was Re: Re: named route new_session not working)
On 1/16/08, Jimmy Palmer <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>
> sorry for the ambiguity. I will work on being more descriptive. :)
>
> In the method access_denied in the file authenticated_system.rb from
> restful athentication, it generates this:
>
> def access_denied
> respond_to do |format|
> format.html do
>
2007 Jul 31
0
Edit not working with named routes
HELP! I''m a relatively new rails user and I''m stuck. I''m trying to
build a relatively simple blog and I decided that I liked the way
named routes look in the code. So I added
map.resources :posts
to my routes.db file. I then went through and updated my controller to
take advantage of the named routes that were generated. I also updated
all of my views and everything
2007 Jun 11
2
Testing create in Rails controller
Hi All
So I am a first-time caller ;-) ... and have been trying to apply
RSpec to the depot example in Dave Thomas'' book as I build the
application.
I am having a problem testing the admin controller create method and
cannot quite see where I am going wrong so was hoping for a pointer :-)
My spec looks like:
describe AdminController do
before(:each) do
@product =
2006 Aug 17
0
super-newb needs help with has_many and other things...
I am brand new to oop and am having a difficult time getting my head
around some ruby stuff. In specific, I am trying to create a library
style app that lists topics, articles and comments. I have a table
called topics, a table called articles and a table called comments. My
models, controller and view are all listed below. What I want to happen
is to have the list view list each topic along
2006 May 14
2
Initialize, instance variable....wrong number of arguments!
Dear RoR Community
My new RoR experience went really smooth for some time until I got stuck
with a seemingly easy problem and the more I have tried to read about it
(PickAxe, Agile WD, forum, etc.) the more confused I got!
What I have done so far as a newbie is to use the scaffold and then
build my own ideas around it. What I am trying to do now is
allow/disallow an action in the input form
2006 Jun 29
1
Problems getting past authentication using functional tests
Hi,
I''m having a problem getting past the authentication mechanism in rails
using my controller functional tests.
my functional tests look like this
def test_4
$stdout.puts ''TEST 4: cookies is '' + cookies.to_s
# :user => {:id => users(:testuser).id}
cookies[:user_id] = ''2222''
$stdout.puts ''1. cookies is ''
2008 Nov 28
1
Rails Beginner.. NoMethodError
Dear all
I encounter error when I login my Web application
NoMethodError in AdminController#login
undefined method `get_title'' for #<Class:0x63ac78>
Here is part of my code
controller/admin_controller.rb
def login
session[:user_id] = nil
if request.post?
if User.authenticate(params[:name], params[:password])
user = User.find_by_name(params[:name])
2008 Dec 05
3
"singleton can't be dumped," but not using singleton
An action handler (select_person_by_name) in my controller class assigns
into session, and then does a redirect_to. I get the error "TypeError
(singleton can''t be dumped):" followed by a stack trace that doesn''t
cross my code.
Google tells me this is ordinarily caused by assigning a singleton
instance into session, but what I''m assigning is an ordinary String.
2008 Jun 12
3
Upgrading to 2.1 breaks my named routes
I just upgraded to 2.1 and attempted to log in to my application and
when this line is reached in my login action:
redirect_to(index_url)
I get the error
"wrong number of arguments (0 for 1)" [stack trace below].
Here''s my route:
map.index ''index'', :controller => ''e_simply'', :action => ''index''
I found
2006 Mar 06
2
Computer Inventory: Problems Retaining Values in a Forms
This is my first rails app and I am creating a Computer Inventory system as
practice. The problem I am having seems trivial, but I can not figure out
what exactly is going wrong, so this is where help from those of you who are
more experienced is needed.
I am having problems retaining the values in some of my forms. Everything
works fine when I am creating or editing a Computer in the inventory
2007 Aug 17
1
Scaffold (Agile Web Development With Rails)
What am I doing wrong here?
[app/controllers/admin_controller.rb]
class AdminController < ApplicationController
before_filter :authorize
def index
list
render :action => ''list''
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
2011 May 21
5
simple home_url question
A silly as this sounds, I''m not sure how to set the route for the
home_path and home_url helpers. Google has nothing on this. Where do I
define what those paths should resolve to?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Jul 03
0
Problem with routes
Hi!
I''ve got small problem with routes and globalize plugin.
Here''s my routes.rb file:
map.connect '':locale/:controller/:action/:id''
map.connect '''', :controller => ''product'', :action => ''index''
map.connect ''admin'', :controller => ''admin/products'', :action =>
2006 Apr 28
9
[AWDR] Tutorial in A4 wont ''destroy'' items
Hello,
I''m working through the tutorial, and I''ve run into a little snag. In
the first part of the tutorial, the destroy link is not working
correctly. I can''t figure out where I goofed. Removing :confirm doesn''t
seem to resolve the issue.
Thanks,
Randy.
development.log
----->8-----
Processing AdminController#destroy (for 127.0.0.1 at 2006-04-27