I'm new to the whole traveling-salesman problem as well as stackoverflow so let me know if I say something that isn't quite right.
Intro:
I'm trying to code a profit/time-optimized multiple-trade algorithm for a game which involves multiple cities (nodes) within multiple countries (areas), where:
The physical time it takes to travel...
I have a problem where I need values passed in from a GET request and I don't know how to set up the routing definition.
My Category object has a type(string),a color(string) and many products. I want to create a simple web service that lets the caller get all of a Category's products by passing in the Category's type and color:
http:...
I have a singular nested resource like so:
map.resources :bookings, :member => { :rate => :post } do |booking|
booking.resource :review
end
Giving me these routes:
new_booking_review GET /bookings/:booking_id/review/new(.:format) {:controller=>"reviews", :action=>"new"}
edit_booking_review GET /bookings/:booki...
Hi,
I add this line in my routes.rb file
map.connect ':controller/:action/:id/:title', :controller => "recipes"
thinking that I am adding the recipe title at the end of the URL and this would only apply to the recipe controller. I have also declared a resource at the beginning of the file like this
map.resources :recipes
The follo...
Hi Guys,
Relatively new to ASP.NET MVC and little confused about how to do routing. My problem basically relates to "logged in" and "logged out routes" and having both as "/".
i.e. I have home/index for logged out user which appears as "/" but this has got me confused as to how I can have home/home for logged in user and still have "/"...
Hi,
Currently I am using ASP.NET MVC and have home/index for logged out user which appears as "/" but this has got me confused as to how I can have "/" for a logged in user?
I could modify like 127.0.0.1/home - but I want it like "/". My confusion relates to the fact that the "/" [127.0.0.1/] is bound in the routes collection to home/i...
How to create route that accept all requests for unexsting controllers, but leave requests for existing.
This code catch all routes
$route = new Zend_Controller_Router_Route_Regex('(\w+)', array('controller' => 'index', 'action' => 'index'));
$router->addRoute('index', $route);
how should I specify route requests like /admin/* or /f...
I have a Model Property which has subclasses using STI,
and which I would like all to use the same controller with only different view partials depending on the subclass.
Property
Restaurant < Property
Landmark < Property
It works find except I'm not sure how to discern the subclass inside the controller to render the correct view. ...
Should all routes in ASP.net MVC follow a "Only slashes, no QueryString" philosophy?
I'm working on a Wiki software, so I have routes like
/{pageTitle}
/{pageTitle/Edit
/{pageTitle/History
etc. for all actions, but what if I want to control the behavior of an Action? Is something like
/{pageTitle}?noredirect=true
okay or considere...
Hi,
I was wondering if anyone knew the thinking behind there decision to do this:
Alot of pages on Apple.com have clean links such as:
http://www.apple.com/wifi/
however some of there pages end with .html
http://www.apple.com/airportexpress/features/airtunes.html
I find it unlikely that these pages are static html pages so....
Why...
Is there a simpler way of writing this:
map.old_site_cusom_packages '/customs_packages_options.html', :controller => :public, :action => :redirect_to_home
map.old_corporate '/corporate.html', :controller => :public, :action => :redirect_to_home
map.old_track '/track.html', :controller => :public, :action => :redirect_to_home
map...
I looked at subdomain-fu and it looks pretty easy to route all non-www and non-'' subdomain requests to a single controller.
But I also, need to send all external domains that are CNAME'd to my domain to the same controller. I have done a lot of searching and I can't find anything.
Summarized, if it is a subdomain on my domain it goes...
First of all, I've seen this: http://stackoverflow.com/questions/589669/how-to-redirect-different-sub-domain-requests-to-different-servers But my problem is different.
I have a platform where a user can create a new website using a submdomain. There will be thousands of these, eg abc.mydomain.com, def.mydomain.com . Hopefully if we ar...
I haven't poured over the RFCs on this one and was hoping that someone would know off-hand.
Pretend I have a basic mail server example.com
I telnet into example.com at port 25 and do something like this:
EHLO hi
MAIL from: [email protected]
RCPT to: [email protected]
DATA
Hello world
.
I think that is valid syntax (if not, let'...
i have an existing rails application to which i am adding a new controller to handle requests from a small facebook app (using the facebooker plugin) i am building.
in the facebook app's config i set the canvas callback url to http://my.host.ip/fb/
in a pure facebook application the url would leave off the /fb/ and the user would be d...
What are extensibility points of URL generation in ASP.NET MVC?
Routes - virtual path depends on it
???
Addendum 1
Particularily, I need to control not only path part of URL but the host also. And I'd like to embed my generation logics into MVC Framework so that any call to standard Html.ActionLink method would involve my logics. It ...
I have a simple controller like this (no, not really, but let's say I do)
public class SomethingController : Controller {
public ActionResult Method1() {
return View("Something1");
}
public ActionResult Method2() {
return View("Something2");
}
}
Now I want to use this controller with two different rout...
I would like to be able to unit test that an HTML.ActionLink or Url.Action will return the correct url based on my route. What is the best way to achieve this.
...
What is the best way to match URL parameter spanning multiple "/" in ASP.NET MVC ?
Eg URL: http://example.com/controller/action/p1/p2/p3/p4
I want to pass just one parameter to the action method (above, it is "p1/p2/p3/p4"). Here, the parameter may have arbitrary number of subitems ( p1/.../pn ).
What is the best way to accomplish th...
I have this sole route in my app:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = ""}
);
This works great for URLs like:
/Blah/Index
/Blah/Create
/Blah/Details/5
I want to add text to that last one like SO does:
...