similar to: Wildcard URL redirect via Rails Routes?

Displaying 20 results from an estimated 100000 matches similar to: "Wildcard URL redirect via Rails Routes?"

2006 Jun 10
2
Migrating to rails... best way to redirect old urls?
Hey all - I''m migrating an app from PHP to Rails and was wondering what the best way to redirect the old urls are. I would like to do a 301 as I''m told that makes Google the happiest. We''re using lighty as the server and I believe it has rewrite capabilities, but I can''t get to their site right now. Anyway, I''m wondering if it''s best
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 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec. I can''t seem to tell rSpec to expect the call @item.user. The following error message plagues me not matter how I try to fuss with the mock: Spec::Mocks::MockExpectationError in ''ItemsController handling POST / items should redirect to the new course on successful save'' Mock
2007 Oct 26
0
Composite Keys on RESTful Routes
I am building an app with existing controllers/actions, using traditional rails routes. I recently started moving over to RESTful routes and have hit a snag. Now I am reconsidering my whole effort and may go back to the original, more flexible, map.connect method. My problem is, one of the resources has composite keys. The keys are both strings as well, and can include dots. Here''s
2008 May 15
1
Remove controller name from URL > nested routes
Hi.. There are my nested routes map.resources :continent do |continent| continent.resources :land do |land| land.resources :destination end end By example it generates this url http://example/continent/azie/land/japan/destination/aomori I want http://example/continent/azie/japan/aomori How can i realize this...? Grtz...remco -- Posted via
2008 Oct 11
0
How to Redirect Rails application from HTTP to HTTPS using lighttpd for WinXP
Hi all, I want to redirect from http to https using lighttpd for winxp, Please explain me. please help me out. Thanks and Regards, Shripad --~--~---------~--~----~------------~-------~--~----~ 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 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my products_controller: require File.dirname(__FILE__) + ''/../test_helper'' require ''products_controller'' # Re-raise errors caught by the controller. class ProductsController def rescue_action(e) raise e end end class ProductsControllerTest < Test::Unit::TestCase fixtures
2009 Jan 12
0
url_for, routes, and the current url
I need to generate 2 types of URL and have defined my routes as: map.country_yes "/:country/ yes", :controller=>"posts", :action=>"country", :yes=>true map.country_no "/:country/ no", :controller=>"posts", :action=>"country", :yes=>false map.yes "/yes", :controller=>"posts",
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
2008 Mar 10
0
Cannot route new actions added to a controller in Rails 2.0.2
Does anyone know of a good tutorial on routing for Rails 2.0.2? I added a new method to one of my controllers and when I point to it by localhost/:controller/:action, I can''t see it! In my routes.rb file, I''ve got: map.connect ":controller/:action" map.connect ":controller/:action/:id" and I''ve stopped and restarted the server
2007 Oct 28
2
failing test with nested controller routes
I have googled and browsed through spec-users archives, but didn''t find anything different. I used rspec scaffold command to generate a mvc for groups, I used nested controller so I could have a separate interface for admin. the specs are the same as generated, so I won''t post the whole thing. I did put the nested routes names on the calls to the name routes: it
2006 Nov 13
5
Routes problem
I want to connect default route to controller Report::SalesController, so I have line: map.connect '''', :controller => ''report/sales'' in config/routes.rb SalesController is in app/controllers/report/sales.rb and is declared as: class Report::SalesController < ApplicationController ... end The problem is that when I try to open root url of my application I
2008 Sep 23
5
Problem getting Rails to emit the correct (proxy) domain in route urls
Behind the scenes my app runs like this: http://myapp.mydomain.com/myapp and and https://myapp.mydomain.com/myapp are Apache 2.2 virtual hosts proxy-balanced to a mongrel cluster on the same machine. But I need to make these available here: https://www.mydomain.com/myapp and https://myapp.mydomain.com/myapp are on a second server using ProxyPass and ProxyPassReverse to
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 =>
2007 Jun 22
1
nested rest URL => passing param from select
Hi, I''m trying to create a select box with an onchange event. When onchange is fired, I want to redirect to a nested rest url. The problem is that I don''t know how to pass the selected value to the url: <select id="category" onchange=" <%= remote_function(:url => category_articles_path(selected value?) ) %> "> Any suggestions? -- Posted
2020 Sep 22
0
New URL redirect checks
Isn't the whole concept of DOI basically link-shortening/redirecting? For example, this link https://doi.org/10.2134/agronj2016.07.0395 redirects to https://acsess.onlinelibrary.wiley.com/doi/abs/10.2134/agronj2016.07.0395 As a side note, I got so fed up with CRAN check complaints about (perfectly valid) re-directs that I refuse to use the \url{} tag anymore. Kevin On Thu, Sep 17, 2020 at
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
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded today) and upon running the generator, doing the migration, prepping the test system and putting the resources in routes.rb I get a Rspec test failure: ''SessionsController logins and redirects'' FAILED expected not nil, got nil routes.rb has: map.resources :users map.resources :sessions nothing else was
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
2007 May 22
2
Refactoring controllers vs. actions
I just completed an exercise of breaking down an existing project and mapping out the controllers and actions, then re-factoring them into some perhaps more RESTful. Though I could be wrong since I am still grasping REST. Most of the controllers mapped perfectly into a REST structure, except for a few. I have Messages, which can respond to all the usual actions, plus a few more. The extras are