routes

How to call the Route Name in Html.ActionLink asp.net MVC?

I have this route routes.MapRoute( "ViewGames", // Route name "psp/{controller}/{action}", // URL with parameters new { controller = "Games"} // Parameter defaults ); and I used <%= Html.ActionLink("God of War", "godofwar", "Games")%> all though it gives me a link like this somesite.com/psp/...

Compojure Routes Issues

I have a small compojure site, with the routes defined as such: (defroutes example (GET "/" [] {:status 200 :headers {"Content-Type" "text/html"} :body (home)}) (GET "/*" (or (serve-file (params :*)) :next)) (GET "/execute/" [] {:status 200 :headers {"Content-Type" "text/html"} ...

Actionlinks add wrong parameter when custom routes is used

I am using this custom route to enable paging in my index method in Home controller: routes.MapRoute( _ "HomePage", _ "Home/Index/{page_num}", _ New With {.controller = "Home", .action = "Index", .page_num = ""} _ ) But when I navigate to any page for example page 2, actionlinks append the page number to the url: ...

One model and controller but slightly different views and routes in rails3

I have a model Notifications, and it basically handles the same few things. A simple contact form, an invitations form, etc. They all have the same generic items... ie Name, email, comment, blah. There might be one slightly different field but they are optional, so I'd like to treat them as one model with a differentiating field calle...

java.lang.OutOfMemoryError: bitmap size exceeds VM budget while overlaying on Google map on Android !

Hi Everyone, What I want to do: I want to setup some routes overlay on google map in android ! What I have done so far: I have parsed the file (geo points) and have them ! I am using asynctask. My overlay class has a custom draw method. I have used destroyDrawingCache () in my draw function. Problems I faced: While running the app, it...

Minimise Zend framework routes

I have routes defined for each module in my application, not heaps perhaps 10 for each module. I have also set up caching of these routes so that the ini files are only parsed once, then stored into a cache file as an array of Zend_Config_Ini objects. This file comes at 100kB. This file is then read each time the bootstrap is parsed (so ...

Standard way of constructing Nested Urls in Rails?

Is there a built-in method in Rails to construct urls from an array of models, given these conditions? Nesting will be 2-3 models deep Each node in the tree will have an unknown class You could have single table inheritance (User, and Admin < User, etc.) How do I create urls from models like this: [@user, @comment].to_url #=> '/user...

How to define a route in Ruby on Rails

I'm trying to define a route in routes.rb and I can't do anything from this Ruby on Rails routing guide that will let this error pass. No route matches {:controller=>"devise/home"} Here's my routes.rb source. SchoolCMS::Application.routes.draw do root :to => "home#index" devise_for :teachers, :admin resources :home, :only => ...

Route fails from one page, succeeds from another

I have one bit of javascript that fires off an ajax request, the result of which gets loaded into a popup dialog. This is the same javascript in all cases, but in one case, the route fails. From the new_army_list page: Started POST "/army_lists/preview" for 127.0.0.1 at 2010-10-13 21:42:15 -0400 Processing by ArmyListsController#previ...

Help with ASP.NET MVC 2 Routes

Is there any reason why a route would be properly mapped in one environment and not another? I am deploying the exact same routing information from my local development server to a production server, and the routes are not being evaluated the same. I have downloaded Phil Haack's Routing Debugger, and it is confirming that the routes ar...

Rails resourceful routes all point to index action?!

I'm runnng Rails 2.3.8. I set up map.resources :users in my routes.rb file. When I run rake routes it shows: users GET /users(.:format) {:action=>"index", :controller=>"users"} GET /users(.:format) {:action=>"index", :controller=>"users"} new_user GET /users/new(.:format) {:action=>"in...

Rails Production server: stylesheets not displaying!

I just switched over from my development database to the production database, and I realized I'm getting a consistent error nomatter what view I try to open. The stylesheets are not loading correctly, despite being in the correct place. Here's some information about the error: View <head> <%= stylesheet_link_tag "global", "home", "htt...

Bundler breaks resourceful routes?

Bundler is breaking my resourceful route! To confirm I created a clean rails app (2.3.4) and made a users scaffold. map.resources :users creates the following: users GET /users(.:format) {:controller=>"users", :action=>"index"} POST /users(.:format) {:controller=>"users", :action...

Catch action parameter in route

I'm making use of hookbox which handles a socket for web. My browser sends information with javascript to hookbox and hookbox forwards the information to my ruby application. The problem is that hookbox sends a parameter called action, so I assume it would look like this. /hookbox/index?action=connect&user=test, when I ask for the para...

Why is this basic Rails 3 route not working?

I've just upgraded to Rails 3, and decided to take it for a whirl with a dummy/sandbox app. The strange thing is I can't seem to get any routes to work! Here's my problem: [cobychapple@shiva:Dev]$rails new TestApp create create README create Rakefile ... [cobychapple@shiva:Dev]$cd TestApp/ [cobychapple@shiva...

Routing POST and GET Requests: Controller or Dispatcher?

When you're making a web app, you frequently need different things to happen at a given URL for HTTP POST requests than happen for HTTP GET requests. I am making a web app in Pylons, and I'm encountering this question. Is it better to distinguish between POST and GET in my URL dispatcher (Routes) or in my controllers? What factors wou...

Ruby on rails form_for and uncountable models

<% form_for(@software) do |f| %> is producing a form tag that looks like this: <form action="/software.%23%3Csoftware:0x24b2eac%3E" ... The software model is a bit special, in that I've made it uncountable (softwares didn't sit well with me) environment.rb: ActiveSupport::Inflector.inflections do |inflect| inflect.uncountable %w...

Why is my Rails web app calling the wrong action?

Hello. I'm diving into Ruby on Rails and I'm experiencing a weird bug, using Rails 3.0.1 and Ruby 1.8.7. Using the generated scaffold code, my "Show" action is getting called when I'm expecting my "Destroy" action to get called. Here's the code... routes.rb webappdotcom::Application.routes.draw do resources :projects root :to =>...

Tracing down routing errors in Rails

I am going through my first RoR tutorial and came up on an action controller routing error. I have checked my code at least 8 times, but can't figure out the issue. I'm sure this will happen again in the future. My question is, in general, how should I go about solving these errors? If it's relevant I am using RVM, Rails 3.0.1 and Ru...

Is there a way to make "rake routes" look better?

I am always forced to make my terminal window two dual monitors wide just to see read them right. I'm not a stickler for buttery GUI's, but this is bordering retarded. Is there a pretty print for this command? ...