I'd like to parse an incoming URL into it's component parts for some pre-processing before passing it into the standard MVC routing logic. For example given your standard route
{controller}/{action}/{id}
and the URL
/user/show/10
Is there a way to have the Routing system return a dictionary containing controller, action and id keys...
Hi,
I've installed Zend Studio 7.1.1 that contains 1.9 framework.
For the server side, I use easyphp (very similar to wamp)
When I create the project, I obviously obtain this architecture:
MyProject
|-- application
| |-- Bootstrap.php
| |-- configs
| | `-- application.ini
| |-- controllers
| | |-- ErrorController.php
| ...
I have deployed my ASP.net MVC site to a shared hosting company. The problem is that now none of the pages except for the home page work. For example if I go to /Account/Register I get a page not found. However, if I go to /Account/Register/Index.aspx then it does work. I have tried modifying the routing to add in that index.aspx but...
I want to be able to do the following:
get '/:slug' do
haml :page
end
get '/administration' do
haml :admin
end
Is there a way that I can have get '/:slug' do have an exception for /administration? I realize you can do this with if else statements:
get '/:slug' do
if params[:slug] == 'administration'
haml :admin
else
...
Hello,
I'm giving a presentation about computer routing and I want to make a good analogy with a real-world situation. However, I could not find it. Do you have in mind any of the situations like the computer routing.
If yes, could you please provide me with it
...
I am trying to upload an ASP.NET MVC application in a shared server running on IIS 6 and Windows 2003. I don't have access to IIS. I've changed the global.asax.cs file as follows:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}.aspx/{action}/{id}",
...
Hi,
I've a very basic ASP.NET MVC application that uses the default routing. Now I need to route all the requests that comes with out a specific URL to one action with a single parameter.
Examples:
www.myapp.com/2374982
www.myapp.com/3242342
should be routed to the same action:
public ActionResult ViewById(intid) ....
Thanks,
Eden...
Due to a prinitng error in some promotional material I have a site that is receiving a lot of requests which should be for one site arriving at another.
i.e.
The valid sites are http://site1.com/abc & http://site2.com/def but people are being told to go to http://site1.com/def.
I have control over site1 but not site2.
site1 contains ...
I have some standard nested routes in my app, and I want to implement subdomains using the subdomain-fu gem. So I'm currently doing this:
example.com/stores/name_of_store/products/name_of_product
and I want to do this:
name_of_store.example.com/products/name_of_product
There seems to have been some discussion about the failing...
I have a file located at [application]/config/routing.yml, when I change something in there, the changes aren't active. This probably has to do with the cache as when I go into that directory [cache]/[application]/prod/config the currently active file can be seen config_routing.yml.php.
The lifetime of the cache is generally 86400 secon...
Hi all,
I want to get the url for my site as "www.ABCD.com/username" without the controller name in MVC architecture, such that when i click the name of the particular user i want to show details of the user with just the name of the user showing in url.
...
I have one controller with few actions. Here is my routes.rb:
map.index 'index', :controller => "main", :action => "home"
map.root :index
map.with_options :controller => 'main' do |main|
main.services 'services', :action => 'services'
main.portfolio 'gallery', :action => 'gallery'
main.about 'about', :action => 'about'
...
Ive got a url: http://dev.local/foodies/view?id=bluedaniel
and ive got in my bootstrap:
protected function _initRoute() {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production');
$router = new Zend_Controller_Router_Rewrite();
$router->addConfig($config, 'resources');
}
and
iv...
Hi folks,
is it possible to add a dot format / .format to the end of any route in ASP.NET MVC .. with a default being html or something?
and of course the .format is an optional value.
sample routes:-
http://whatever/controller/action.format
http://whatever/controller/action
those goto the same action method.
cheers!
...
In this piece of code:
ActionController::Routing::Routes.draw do |map|
map.resources :line_items
map.resources :orders
map.resources :products
map.resources :categories
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.register '/regis...
Hi,
I'm finishing the API of our web service. Now I'm thinking on how to make the route changes, so if we decide to make a new version we don't break the first API.
right now:
url: /api/:action
param: { module: api, action: :action }
requirements:
sf_format: (?:xml|json)
what i've thought:
url: /api/v1/:module/:action
param: { mo...
I want to use URL such as /Image/sample.png
I create route, but it does not work, it say "The resource cannot be found"
What is the problem? (action GetImage is in controller home)
routes.MapRoute("Image",
"Image/{id}",
new { controller = "Home", action = "GetImage", id = "" });
...
What would be the best way to set up my routes so different types of posts have different URLs?
For example, regular posts are /posts/slug while featured posts are /featured/slug
Both link to the same controller and action /posts/view/slug.
I experimented with different ways of doing this but with little success. Currently my link par...
Hi-
I have a website created in VS 2008 using asp.net v3.5.
My requirement is to add both Routing and Infragistics controls the website. But noticed, I can have only one of these working - not both. My infragistics control works if I remove the following from web.config
But by removing it- routing would not work.
Is there a way I...
Hi,
i'm creating a mvc application and i'll use under subdomain like
http://myapp.mycompany.com
This subdomain is pointing to app subdirectory, but my actions are always generated with applicationPath (subdirectory) like:
http://myapp.mycompany.com/myapp/Home/About
// I want just this without additional paths
http://myapp.mycompany....