I am working on a .NET MVC application and am trying to write a route in global.asax.cs. The goal is, I want any URL that contains an uppercase character to run through said route. The idea is, the router will lowercase the URL and redirect it. My approach is to use a regular expression to handle this. Here's what I have:
routes.Map...
I'll preface this with the fact that I'm new to RoR. I have a class that resides in a nested module, ::Physical::Users::User. The code is organized into paths such as app\controllers\physical\users.
My problem comes when I try to use form_for like this:
<% form_for @user do |f| %>
...
<% end %>
I get the error ActionView::Templ...
I have a Rails 3 application, say, with hotels, where hotels belong to parent areas. When a user hits the app (served by mongrel >> nginx), I want the domain name used in the request to decide what area of hotels to serve up (domain name >> area). To achieve this I can see two options:
1) Rewrite the URL with nginx, inserting the are...
Hi All,
Query:
I have a link like
<%= link_to "link_name", :controller => "some_controller", :action =>
"some_action", :id => "some_id", :first_param => {:second_param => "some
value"} %>
and in my routes.rb
map.connect '/some_name/:id' :controller => "some_controller", :action
=> "some_action"
Above code is giving me a URL like
...
I'm not sure how to fix this, or wat is the best way to approach this. Also couldn't find enough information to get me on the right way (could be that my searching sucks..)
Anyway, this is my problem:
I defined a route in my bootstrap file:
protected function _initRoutes()
{
$router = $this->frontController->getRouter();
...
I'm having trouble in my application where a controller is calling a method and the server is reporting that the method doesn't exist.
This is the method call. The method not working is tag.related_tags
@related_tags = @tags.collect { |tag| tag.related_tags }.flatten.uniq
The Tag model is originally defined in an plugin acts-as-tagga...
I am looking for a way to decide the routes based on a request parameter.For example i want to have route a request to web controller if it has params[:web] and to iPhone if it has params[:iphone]. Is it possible to do so keeping the names of the routes same but routing them to different controllers/actions depending upon the parameter?
...
hi,
I have started using cakePHP and have a little problem using routes. I'm trying to make some kind of catalog for products (e-shop without shopping :)) and like to have urls like "http://site.net/main_category/subcategory/subsubcategory-c154.htm" where -c means category and 154 is an Id of specified category. I like to pass this type...
I have two routes mapped in my MVC application:
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Project",
"{controller}/{projectid}/{action}/{id}",
new { ...
I have a rails route that is based on two conditions, that the domain and subdomain are a specific value. The problem is that there are multiple possible values for subdomain to work, but I can't seem to be able to pass them as an array or hash.
map.with_options(:conditions => {:domain => AppConfig['base_domain'], :subdomain => 'www'..'...
I have several chained routes that handle the multi-lingual feature of my site. Sample:
$languageRoute = new Zend_Controller_Router_Route_Regex('(de|en|es|fr|it|ja|ko|pt|ru|zh)',
array(1 => 'en',),
array(1 => 'language'),
'%s'
);
$defaultRoute = new Zend_Controller_Router_Route('*',
array('module' => 'default',
'controller' => 'p...
I have the following route defined:
map.resources :images, :only => [ :index, :new, :destroy ]
when I do a rake routes I get the following:
image DELETE /images/:id(.:format) {:action=>"destroy", :controller=>"images"}
My problem is, I would like to use file names as my :id including any extension. At the moment my ids are getting ...
Hi folks,
can I have a route like...
routes.MapRoute(
"Boundaries-Show",
"Boundaries",
new
{
controller = "Boundaries",
action = "Show",
locationType = UrlParameter.Optional
});
Where the action method is...
[HttpGet]
public ActionResult Show(int? aaa, int? bbb, LocationType locati...
By default the RESTful controller in Pylons supports single-part IDs for objects. This works for some kinds of objects, but my domain model has a set of objects that have composite identifiers, and I'd like to be able to build good URLs for those as well.
This is what is currently supported:
GET /advanis/saas/projects/id: Show a specif...
Hi,
I have been trying to shortern this route:
http://abc.localhost/user/view/index/id/1
to this:
http://abc.localhost/user/1
with the following portion of code in my bootstrap but I keep getting an error stating that the 'Reversed route is not specified', any ideas why?
$route = new Zend_Controller_Router_Route_Regex(
'user/(\d+...
Hi,
I have this route setup in one of my bootstrap files...
$route = new Zend_Controller_Router_Route_Regex(
'user/(\d+)',
array(
'module' => 'user',
'controller' => 'view',
'action' => 'index'
),
array(
1 => 'id'
),
'user/%d'
);
$router->addRoute('user', $rou...
I have the following routes setup in my route config file. I have a config reader that maps these to MVC-style routes.
[route name="customers" url="customers/{statename}/{marketname}/{pagenumber}"]
[controller name="Customers" action="Display" /]
[/route]
[route name="pcustomers" url="{customername}/customers/{statename}/{ma...
I'm interested to know how people handle the following situation.
Assume we have a DataField and each DataField can have unlimited number of DataValues
We have 2 controllers to handle the manipulation of these objects
DataFieldController
DataValueContoller
Now if we ever need to add a new DataValue we need to know the ID of the Cus...
I am trying to get the routing information from a random URL (part of my application).
I tried to instantiate a Zend_Controller_Request_Http with an URL but it didn't fill in the controller, module, action fields automatically.
I suppose it should somehow be linked to the Route info but cannot figure how to connect this.
Any leads?
...
Hi! I'm doing a Route Planning Application using OpenStreetMap. The target area is the National Capital Region of the Philippines. I need the road vector data and some of the other POIs for the project. I'm thinking if it is better to get the data (the .OSM files) and place it in my own database or contribute to the Online database inste...