routing

Render controller action from another controller

I think the code is more explicit option A class RedirectController < ApplicationController def index redirect_to :controller => 'posts', :action => 'show', :id => 1 # it works end end option B class RedirectController < ApplicationController def index render :controller => 'posts', :action => 'show', :id => 1 ...

routing scope problem with form_for (partial)

Trying to route: scope :shortcut do resources :text_elems end Using basic scaffold with form partial *_form.html.erb* <%= form_for(@text_elem, :shortcut => @shortcut) do |f| %> ... Problem is: When I call the edit action, the form html shows as: <form ... action="/25/text_elems/25"> Note: The new action renders the form acti...

alias url with sinatra / padrino

I've this and it works get :about, :map => '/about_us' do render :erb, "<%= 'foo' %>" end get '/:slug' do redirect "/about_us" # <-- end Is possible to do in some way "render" instead of "redirect"? or something like render 'posts/1' ...

whats the best way to pass a full date time into a URL in asp.net mvc

i have a full datetime object that i need to pass in as a parameter in a URL. what is the best way to do this so it fully can get converted to a csharp DateTime object and not lose any precision ? ...

Rails Routing Conditional with multiple value options

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'..'...

Codeigniter isn't routing right

I installed Apache for Windows. I bought CodeIgniter Professional and downloaded their source code. It said that I should put its .htaccess in the root folder of the website so I did. I set base URL to be http://127.0.0.1/kids/ where kids is the root folder of the website. It showed the homepage just fine. When I clicked on a link, it al...

How to know which route was selected?

Hi everybody, I have created a function in the bootstrap to do the routing. Once a route has been selected I would like to know which one it is. Ideally I would like to be able to get that information in the bootstrap too, let's say I have a 1st function _initRouting() which decides of the routing and then later in the bootstrap a 2...

How can I append .html to all my URLs in cakephp?

I am using cakephp in one of my projects and my client wants the site URLs to end with .html and not the usual friendly urls. I was wondering if its possible in cakephp to do so through any of its routing techniques. Please help. ...

Rails route which disappears in application but is present in rake routes...

Hello, I have a mystic problem.... In my routes.rb I have some routes defined and for exemple resources :projects, :except => [:destroy] do get :edit_flyer, :on => :member get :guests, :on => :member end If I run a rake routes, I get edit_flyer_project GET /projects/:id/edit_flyer(.:format) ...

Rails 3 add GET action to RESTful controller

I have a controller with the 7 RESTful actions plus an additional 'current' action, which returns the first active foo record: class FooController < ApplicationController def current @user = User.find(params[:user_id]) @foo = @user.foos.where(:active => true).first #use the Show View respond_to do |format| for...

Zend Framework - Router Rewrite with Regex

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+...

ASP.NET MVC - How to throw a 404 page similar to that on StackOverflow.

I've currently got a BaseController class that inherits from System.Web.Mvc.Controller. On that class I have the HandleError Attribute that redirects users to the "500 - Oops, we screwed up" page. This is currently working as expected. THIS WORKS <HandleError()> _ Public Class BaseController : Inherits System.Web.Mvc.Controller ''...

MVC Routes: Adding an optional parameter at the beginning of a route

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...

ASP.NET MVC - Use Reflection to find if a Controller Exists

I'm having a heck of a time figuring out how to properly implement my 404 redirecting. If I use the following <HandleError()> _ Public Class BaseController : Inherits System.Web.Mvc.Controller ''# do stuff End Class Then any unhandled error on the page will load up the "Error" view which works great. http://example.com/user/999 (whe...

Optimizing A-Star Algorithm

I have implemented the A* Algorithm According to Wikipedia's implementation at here However, it is too slow to run in mobile devices. I have to wait endless hours to finish the function though it runs fine on desktop computer. Is there anything I can do to optimize the algorithm? Here's the actual code public DriveRoute findroute(rout...

Implement Content-Based Routing Using a Business Rules Policy for a Known Message Type does not work using Samples

Hi, I'm fairly new to Biztalk and the ESB Toolkit, We have since tried to implement content based routing via an ESB Itinary but I am having problems with the condition on the business rule not evaluating properly, I've been following the microsoft example in the link below but it just doesn't want to work. http://msdn.microsoft.com...

Redirecting and routing ruby on rail

I'm still new to ruby on rails and I'm currently having a issue with routing and redirecting. I have two controllers "candidate" and "survey". I'm currently viewing "canidate/editEmail.html" http://www.otoplusvn.com/TherapistSurvey/candidates/editEmail/2 Once the submit button is clicked, the candidate's method for updating the ema...

How do you link to a route inside a Symfony form class?

How do you insert a link_to into the 'invalid' message of a regular Symfony form? My form extends the sfGuardUserForm: class SignupForm extends sfGuardUserForm { public function configure() { ... new sfValidatorPropelUnique(array('model' => 'sfGuardUserProfile', 'column' => array('email')), array('invalid' => 'This email a...

mvc2.net how to remove ambient route values

Hello Everyone, in my mvc2 application i have an action link like <%=Html.ActionLink("dash.board", "Index", pck.Controller, new{docid ="",id = pck.PkgID }, new { @class = "here" })%> docid is set to empty string because i want to clear ambient value of docid that is present in request context. i have gone through a lot of material o...

Web Service Call Routed through an Intermediary - vb.net client

I need to access a 3rd party web service. The computer that needs to make the call does not have internet access so it needs to go through a 2nd internal computer that does have internet access. I'm fairly new to consuming and using web services. Through searching I've established that I need to use some sort of routing to do this. ...