Ruby on Rails routing problem - ruby-on-rails

The company that hosts my website did an upgrade on the weekend and now all my ROR apps are coming up with this :
Routing Error
No route matches "/geotest/" with {:method=>:get}
These were working before and do work on my development system, but there has been no response to my ticket to their tech support. Anyone got a suggestion how I could fix this?

Maybe they upgraded to Rails 3 ? Your route should work anyway, but try to add this to your routes.rb file :
get '/geotest' => 'your_controller_name#index'
Change your_controller_name accordingly, of course.

Related

conflict between websocket url and routes in rails

dear all of master in rails
I am new in developing web app using rails.
Now, i want to try create an app rails using web socket.
I get good tutorial from here
However, when i improve my experience in rails. I get conflict between url websocket and url created in routes.rb
in my routes.rb
get ':username' => 'users#profile', as:"profile"
the url get conflict with url web socket and then, my web app websocket getting failure.
anyone could help me to solve my problem..???
thanks
I fixed this using a routing constraint:
get '/:hash', to: 'conversations#show', constraints: {hash: /((?!websocket).)*/}
The route will not work unless the :hash does not contain the string "websocket"
I'm sure there's a better regex out there, and if my hash ever randomly contains the string "websocket" it'll fail.
But, this fixes your problem for me in development.
What is the error exactly?
You need to change the route
get '/username' => 'users#profile', as:"profile"
I think your should read this

Did Rails Routing change the way it handles the params[:path]?

I recently upgraded a site from Ruby 1.8.7 to Ruby 1.9.2, and from Rails 3.0.x to 3.2.x. I noticed that some of my legacy urls weren't being handled correctly anymore, and wanted to diagnose the issue.
Here's what I noticed.
http://myapp.com/links/oldlink.html had, in my old app, provided a params[:path] of /links/oldlink.html, but now is providing links/oldlink. So it's dropping the leading forwardslash as well as the file extension.
Can anyone help me figure out what's going on here? Of course I can manually change the legacy strings in my database to also drop their forward slashes and file extensions, but that seems like a hacky solution, and I want to make sure I understand the underlying principles that account for this change in the Rails routing behavior.
Thanks!
You should try this in your routes.rb
match '/foo', :to => redirect('/foo.html')

Rails 3.2.8 Routing Error

Started learning Rails a couple of hours back using the book Agile Web Development with Rails and hit a roadblock straightaway.
Created a controller called Say using:
rails generate controller Say hello goodbye
Then I was trying to hit the URL http://localhost:3000/Say/hello but it says:
No route matches [GET] "/Say/hello"
My routes.rb looks alright too (at least from what the other answers on the same question say):
Demo::Application.routes.draw do
get "say/hello"
get "say/goodbye"
end
Any help? Just not able to figure this out.
Looks like a capitalization error. Can you go to
http://localhost:3000/say/hello
Lowercase s in say
It's case-sensitive.
Try to reach it at http://localhost:3000/say/hello

Rails and a development domain

I'm trying to use http://ls1.bigseapreview.com as a domain for a Rails project. The problem is it doesn't seem to be correctly mapping any routing apart from the home page.
I have added /about but you can see that you will just get a 404, but it works locally.
What do I have to do to fix this?
Can you add your routing file?
+I added /about and it looks like it's working
Are you sure that this is a Rails project? Your "about" link points to "/about.php".

Rails Routes Question

Did the rules for Rails Routes changes from Rails 1.2.3 to Rails 2.2.3? I recently upgraded an application and instead of redirecting to the correct page, it now redirects to the main page (or Route page) for that matter.
The only thing that I can think of is that the routing rules changed in Rails 2.2.3.
Thanks
Yep there were a lot of changes as you can see here (look at the Action Pack Resources section) "This is where the bulk of the action for 2.0 has gone". If you're using the old semi-colon syntax then that could well be the problem. Do you want to post your route config and a quick description of what is not working?
Also, to diagnose routing problems I find running "rake routes" very useful (though set your terminal window to wide).
Chris

Resources