Displaying 20 results from an estimated 80000 matches similar to: "Cannot route new actions added to a controller in Rails 2.0.2"
2006 Oct 16
0
Restful routes, not repeating yourself and non-standard rest actions best practices
So I''ve recently started playing with the restful routes support in
edge rails, converting a few of my controllers to support all the
standard operations.. One thing that''s been bothering me, however, is
the following:
Before using restul routes, I would define an edit method in my
controller which would be responsible for both creating new objects as
well as editing
2007 Jun 13
0
Routing Error (was: Re: Action Controller: Exception caught)
On 6/12/07, Thufir <hawat.thufir-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> I just want to get a listing of my database, as I''ve done with a dummy
> example. Right now I''m getting:
>
> "Routing Error
>
> no route found to match "/legacy/list" with {:method=>:get}"
> <http://localhost:3000/legacy/list>
>
>
2006 Mar 06
0
Multiple actions for one route (making pretty URLs hit different actions)
Hi all,
I''m trying to make pretty URLs using routes for some of my actions
across different controllers. For example:
http://www.example.com/london ->
http://www.example.com/articles/show_by_name/london
But if the id ''about'' couldn''t be found, then to search for it as
another action, this time from the ''branch'' controller.
2008 Apr 05
1
Problems getting file upload to work on rails 2.0.2
Hey Guys,
I''m trying to upload a file to rails. I thought it would be pretty
straightforward but I''ve run into a peculiar bug... the form I''m using
is shown below and then the error message.... any suggestions or
diagnostic hints would be appreciated. I''m running rails 2.0.2 and ruby
1.8.6
<form method="post"
2007 Dec 11
4
Lost in translation - Rails 2.0 Nested Resources, Custom Actions
The shift to the :has_many and :has_one options when defining nested
resource routes has me perplexed. The block format allows me to define
custom REST actions like publish in the example below:
map.resources :users do |user|
user.resources :articles, :member => { :publish => :put }
end
It also allows for multiple levels of nesting if necessary.
What I''d really like to
2009 Jan 10
0
General Question about route generation Rails 2+
I have been searching for the definitive answers regarding routes and
new controllers, so far no clear statement: Rails 2+ route
generation, is it done only once at start up of mongrel? Is this only
a dependency on how mongrel does things - looking for updates of
config files on the fly or is it a Rails limitation?
You see I also have used servlets and JSP, it seems there you can add
new jars
2008 Aug 23
1
Route segment ":controller" cannot be optional because it precedes a required segment.
Hi,
With this route...
map.namespace :admin do |admin|
admin.sort ''/:controller/sort/:sort_by/:sort_dir'', :action => ''sort''
end
...I get this message...
Route segment ":controller" cannot be optional because it precedes a
required segment. This segment will be required.
The route works as expected, but the warning is worrying. Any ideas?
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
Hi guys! ;)
If you set "routes.rb" as:
map.resources :pocoyo
You have RESTful rails routes facilites. Ok, let''s focus on these two
maps:
"http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller
and "index" action.
"http://domain.com/pocoyo" [POST] is mapped to "pocoyo" controller
and "create"
2010 Apr 28
0
Route globbing in Rails 3 beta 3
I was just playing around with the new routing dsl to answer someone''s
question on the general rails forum.
I wanted to see how Rails3 handled globbed routes. So I added this
to routes.rb
get ''forum/*path'' , ''forum#show''
And had the show action just display the params.
with a URL of /forum/a/b/c
I got {"path" => "a/b/c"}
2009 Jan 26
0
undefined method error for a polymorphic route
Hi, I''m trying to upgrade a 2.0.2 app to 2.2.2, but first I decided to
upgrade to 2.1.2 after reading some posts recommending to do this.
After firing up the app and running my tests, I now see that my
polymorphic routes seem to be broken.
test_should_create_footerpage(PagesControllerTest):
NoMethodError: undefined method `footerpage_url'' for #<PagesController:
0x4814648
2007 Dec 28
1
Getting wrong route - fairly complete error description
OK, I have a routing problem, that seems to be working in the console,
but not in the app.
I have people that have nested tasks, like so:
-------------------------------
# routes.rb
map.resources :people do |person|
person.resources :phone_notes
person.resources :documents
person.resources :tasks, :member => {:complete => :put}
end
map.resources :tasks, :member => {:complete =>
2008 Feb 15
3
Ajax problem with rails 2.0.2 - frozen string?
I am deploying a new rails application on a shared host (hostingrails)
for the first time. My local app works great. However, Ajax requests
in the deployed application are generating the following error:
/!\ FAILSAFE /!\ Fri Feb 15 08:44:59 -0600 2008
Status: 500 Internal Server Error
can''t modify frozen string
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
2008 May 07
2
Can I add a singleton action to @controller in a test?
All,
I want to create a mock action to test a filter in a functional test,
e.g.:
# Simplified example
def test_my_filter
# Singleton action
def @controller.foo
assert # something
end
ActionController::Routing::Routes.draw do |map|
map.connect '':controller/foo'', :action => ''foo''
end
get :foo
end
My log files show that
2008 Sep 23
1
Help with "No route matches "/MyTest/" with {:method=>:get}"
I just started working with Ruby. Anyways I can''t seem to figure out
how to have this message disappear. I was reading a tutorial and based
on it, when I type in http://localhost:3000/MyTest/ it should say
whatever I have written down on my my_test_controller.rb file.
I first ran: ruby script\generate controller MyTest
then I edited the my_test_controller.rb file
It currently says:
2008 Dec 02
0
Best route for has_many subrecords
Hello all,
I have a model, say it''s called Person, which has_many Responsibilities. I
would like the "show" view for the person controller to list all of the
responsibilities for that person. (That''s the easy part -- I think I know
how to do that part.) At the end of the list, I would like to include a
text field into which a new responsibility may be added. What
2007 Dec 28
1
WEBrick.. won't start and showing '/rails-2.0.2/lib/initializer.rb:159:in `require_frameworks': Could not find RubyGem jruby-openssl (>= 0.0.0) (RuntimeError)' errors
Hi
WEBric won''t strat and showing the following errors:-
=> Booting WEBrick...
/mnt/slash/home/akumar/jruby-1.1b1/lib/ruby/gems/1.8/gems/rails-2.0.2/
lib/initializer.rb:159:in `require_frameworks'': Could not find RubyGem
jruby-openssl (>= 0.0.0) (RuntimeError)
from /mnt/slash/home/akumar/jruby-1.1b1/lib/ruby/gems/1.8/gems/
rails-2.0.2/lib/initializer.rb:156:in
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi,
how is it possible that I can use the restful routes helpers (e.g.
new_user_path) in controller specs? I browsed the source code but I
couldn''t find the magic. I''m just curious and would appreciate any
hint...
thanks
Andi
2011 Jun 03
0
Rack Middleware support for Rails 2.0.2? If not what is the alternative to implement similar functionality in Rails 2.0.2..
Hello all,
I am using Rails 2.0.2 and Ruby 1.8.7 and I need to make use of rack
middleware for integrating an ajax file upload plugin(https://
github.com/valums/file-uploader) with paperclip in Rails( As given in
this tutorial:-
http://mooooooooooo.wordpress.com/2010/12/03/paperclip-valums%E2%80%99s-file-uploader-and-middleware-continued/).
I have referred to the rack-middleware Railscast by
2005 Dec 18
2
Default routes for unknown actions
Hi folks-
I have the following map for default ''junk'' routes:
map.connect ''*anything'', :controller => ''welcome'', :action =>
''unknown''
Which works just fine for a URL like: "mysite.com/junkjunkjunk"
However, it still tries to resolve an action when I do:
"mysite.com/my_controller/junkjunkjunk"
2008 Feb 01
0
javascript_include_tag and controller actions
Hello folks,
I''d like to include the javascript generated by an RJS file in an
RHTML file using the <script></script> tags. I was going to use
javascript_include_tag to do this, mostly in order to ensure that the
contents are not cached by the browser.
Unfortunately, javascript_include_tag appends a ".js" to the file name
if there is not a period in the file name.