Displaying 20 results from an estimated 100000 matches similar to: "Cache routes.rb in development?"
2008 Jul 19
2
renaming routes.rb
When you create a new rails app the default home page says to rename
routes.rb. I tried this, but when I run script/console or script/server
I get an error saying the routes.rb file can''t be found. If you rename
this file is there an environment variable holding the location
elsewhere in the application?
--
Posted via http://www.ruby-forum.com/.
2007 Jan 19
6
Problem w/ routes.rb
I am trying to develop a new webapp using Rails 1.2.1. I am installing
it onto a production web server running Apache w/ fastcgi. The server
already has some older webapps running on it using an older version of
Rails. The apps are not installed in the document root; they each have
their own subdirectory which is a symlink for the apache document root
to the "public" directory of each
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many
of the other, implemented through a join table (so it''s like a habtm
without the habtm).
For the next version of our app, we''re refactoring to RESTful, and i''m
having trouble with my nested resources/routes. I tried this, in
routes.rb:
map.resources :assets do |assets|
assets.resources
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
2009 Jan 10
0
has_many in routes.rb
Hi
I saw
map.namespace(:admin) do |admin|
admin.resources :accounts, :has_many => [ :credentials ]
end
and I wrote like
map.namespace(:admin) do |admin|
admin.resources :accounts do |account|
account.resources :credentials
end
end
The only difference I found is, in the first no helper methods
are generated..I would like to know is that the
2010 Mar 23
1
:has_many and :controller specified in routes.rb
Have an app using older version of Rails (2.3.2) that I need some
routing assistance with if anyone has a minute.
The app was originally designed to be purely html view, and an xml and
json api was hacked on. To keep it clean, we are now moving the first
version of the api (v1) under its own directory (v1) under app/
controllers but still responding to the old paths.
One of the parts of the new
2008 Jul 11
1
Using custom routes to handle new nested resources
I have a couple of resources, one nested in the other, such that my
resource spec in routes.rb is:
map.resources :parents, :has_many => :children
This will generate a route for a new child that assumes that the parent
has already been saved, something like:
/parents/:parent_id/children/new
But what if I want a route that handles the case where the parent
resource is also new, and thus
2012 Feb 01
0
Rails 3.1 form & routes.rb [newbie]
Hi all,
maybe is a newbie question anyway
1. I create de rails app with
# rails new {my app}
2. after I add some gem to my Gemfile
source ''http://rubygems.org''
gem ''rails'', ''3.1.1''
gem ''sqlite3''
gem ''simple_form''
gem ''execjs''
gem ''therubyracer''
# Gems used only
2011 Jan 10
0
UTF-8 routes.rb and Passenger vs. Mongrel/WEBrick
My (Rails 3) routes.rb has the following entry:
resources :articles, :path => "記事"
This works in my production environment, as passenger unescapes the
path from /%E8%A8%98%E4%BA%8B to /記事.
However, in my development environment, I''m using Mongrel, which does
not unescape the path, so it does not work unless I change my routes
to
resources :articles, :path =>
2007 Jun 28
2
form_tag routing error in >= 1.2.2 ?
I have a simple feedback form handled by feedback_controller. For
methods I use "new" for the form and "create" to handle the feedback
submitted.
Routes are simple enough:
map.resources :feedback
What''s odd is this works fine in Rails 1.2.1:
<% form_tag(feedback_path) do -%>
But in Rails 1.2.2 and 1.2.3 I get:
feedback_url failed to generate from
2009 Jan 04
4
Adding routes and link_to
Hello.
I''ve added some routes :
map.news ''news'', :controller => :News, :action =>:index
map.login ''login'', :controller => :Login , :action =>:index
When I go to /news or /login before adding the routes, it works well.
When I add the routes and clik on the link that goes to /news or /
login, I got a 500 internal error with this :
2007 Dec 28
1
Rake routes & console showing one thing, app doing another
OK, I have a routing problem, that seems to be working in the console,
and with rake routes 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
2010 Jul 27
0
Using an ActiveRecord model in routes.rb
Is it potentially dangerous to use an ActiveRecord model in routes.rb?
Here''s a line from our routes.rb file:
> map.resources :registrations, :requirements => { :id => User::USERNAME_REGEXP }
Registration#to_param returns the User''s username.
User::USERNAME_REGEXP is just a regex that matches one or more valid
username characters.
This route works as expected, but my
2008 Apr 03
3
routes.rb definitions not working???
Hello Eveyone,
I am new here, and am have no idea how to setup routes in the routes.rb file
while using fbml. The regular
map.resources :gifts
map.resources :wishlists
map.resources :invitations
map.resources :comments
does not work.
This tutorial
http://rfacebook.wordpress.com/2008/02/04/quickstartfacebooker/
says to create a map.root, such as the one mentioned "map.root
2008 Jul 08
5
map.root doesn't do anything, index.html can't be changed
Environment:
Apache/2.2.8 (Ubuntu)
DAV/2
SVN/1.4.6
PHP/5.2.4-2ubuntu5.1 with Suhosin-Patch
mod_ruby/1.2.6
Ruby/1.8.6(2007-09-24)
mod_ssl/2.2.8
OpenSSL/0.9.8g
Phusion_Passenger/2.0.1 Server
I''ve created several scaffolds that all work, and am trying to set the
root page for this app to default to one of the methods. Here''s my
routes.rb:
ActionController::Routing::Routes.draw do
2008 Feb 28
2
REST nested routes with has_one
Hi everyone,
I have 2 models:
class User < ActiveRecord::Base
has_one :laboratory, :foreign_key => "pi_id"
end
class Laboratory < ActiveRecord::Base
belongs_to :pi, :class_name => "User", :foreign_key => "pi_id"
end
I set the following routes (in routes.rb):
map.resources :laboratories
map.resources :users, :has_one => :laboratory
All the
2009 Mar 14
2
Pobrem with REST routes
Hi first at all sorry if mu english is not the best.
I have this models:
Encuesta->titulo and description are string. Encuesta has_many
:preguntas
Preguntas-> texto is string, encuesta_id and orden are integer. Pregunta
belongs_to :encuesta and has_many :soluciones
Soluciones-> texto is string, pregunta_id and orden are integer.
Soluciones belongs_to :pregunta
Routes:
map.resources
2009 Feb 20
1
RESTful Routes not working - Switches ID and Action
Hi,
I would like to ask for some suggestions on my problem with Routes. It''s
probably pretty simpel.
This link:
<%= link_to image_tag("...", :alt => "...", :title => "..."),
edit_brand_path(brand) %>
Results in this URL:
http://localhost:3000/brands/21/edit
And echos this:
"Unknown action - No action responded to 21"
When I type
2006 Apr 20
0
Custom path overriding - routes.rb
I want to be able to have custom URL paths to some of my data.
For example, I might have some entries in my "item" table like:
id=1, title="Test", path="/test.html", content="some test content..."
id=2, title="Example", path="/another/example/", content="some
example content..."
id=3, title="Some more",
2006 Mar 04
0
Reading from Session in routes.rb?
Hi all,
I''m developing some custom routes for an application and am creating the
aliased url_for commands that I like so much. However, one of the things I''d
like to do is read a string from the session (or possibly even pull out an
object to get to the string) and use that in the URL generating by the route
-- without having to pass the string into the url_for alias every time.