routes

Symfony routing with an API Web Service

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

How to customize RESTful Routes in Rails (basics)

I have read through the Rails docs for Routing, Restful Resources, and the UrlHelper, and still don't understand best practices for creating complex/nested routes. The example I'm working on now is for events, which has_many rsvps. So a user's looking through a list of events, and clicks register, and goes through a registration proces...

Attaining Explicit and Predictable Ruby on Rails...

I need help, how can I learn this framework? Here's what I need to know. Routes, its expected outcome, the prefix/suffix methods associated with every changes made with it. ActiveRecord, the dynamic generation of methods, the behind the scenes with prefix_ and _suffix methods. The View, how do I know what prefix/suffix methods can be ...

Pylons/Routes Did url_for() change within templates?

I'm getting an error: GenerationException: url_for could not generate URL. Called with args: () {} from this line of a mako template: <p>Your url is ${h.url_for()}</p> Over in my helpers.py, I do have: from routes import url_for Looking at the Routes-1.12.1-py2.6.egg/routes/util.py, I seem to go wrong about line it calls _screen...

Ruby On Rails Paths

I am having trouble with paths in ruby on rails My Routes: map.resources :companies do |company| company.resources :customers do |customer| customer.resources :jobs end end Currently I am creating the paths by hand: <td><%= link_to 'Show', "/companies/#{params[:company_id]}/users/#{user.id}" %></td> <td><%= link_to 'Ed...

Possible to create this redirecting route in Rails?

Is it possible to do a redirect in the routes file of a Rails app? Specifically, I'd like to forward /j/e to /javascripts/embed.js Right now the only way I can think to do it is to create a j controller with an e method that redirects to that. ...

Call named routes in CakePHP as the same way in Ruby on Rails

How can I call a route (in the view) in CakePHP as the same way in Rails? Ruby on Rails routes.rb map.my_route '/my-route', :controller => 'my_controller', :action => 'index' view link_to 'My Route Name', my_route_path CakePHP routes.php Router::connect('/my-route', array('controller' => 'my_controller', 'action' => 'index')); ...

Regarding Authlogic and page redirection.

I am using authlogic for authentication in my Rails app. Have named routes for the frequent actions, viz: map.login "login", :controller => "user_sessions", :action => "new" map.logout "logout", :controller => "user_sessions", :action => "destroy" map.register "register", :controller => "users", :action => "new" map.ed...

Shorter Rails routes

Hello, I have a thing blog application, and I would like to shorten my routes. Here there are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command build the following lines: GET /categories/:category_id/art...

how to create Codeigniter route that doesn't override the other controller routes?

I've got a lot controller in my Codeigniter apps, ex: Signup, Profile, Main, etc.. Now I want to build "User" controller. what I want: if people goes to url: example.com/signup, I want use default route to "Signup" Controller if people goes to url: example.com/bobby.ariffin, I want to reroute this to "User" Controller because the url...

Rack URL Mapping

Hi, I am trying to write two kind of Rack routes. Rack allow us to write such routes like so: app = Rack::URLMap.new('/test' => SimpleAdapter.new, '/files' => Rack::File.new('.')) In my case, I would like to handle those routes: "/" or "index" "/*" in order to match any other routes So I had trying this: ...

Search Route in ASP.NET MVC

Hi. I have a simple search form in my master page and a serach controller and view. I'm trying to get the following route for the string search term "myterm" (for example): root/search/myterm The form in the master page : <% using (Html.BeginForm("SearchResults", "Search", FormMethod.Post, new { id = "search_form" })) ...

Cakephp 1.3, router and authentication problem

Trying to implements simple privileges for admin user. Don't need huge acl rules and groups system. There are admin users, overs - just registered users. They can't access actions with admin prefix. So It was implemented in cakephp1.2 version with following code in app_controller: function isAuthorized() { if (isset($this->params[Co...

Ruby on Rails - Static page as start page

Hello! I am developing an app in RoR which has static and dynamic parts. The static portion is placed in the public/ folder of the app. Now if i have an index.html in my public folder then i will not be able to use the routes configured in my routes.rb The default configurations like map.connect /:controller/:action will not be usable i...

How can I remove index.php using Codeigniter on XAMPP ?

I can't hide Codeigniter index.php on XAMPP 1.7.3 URL: http://localhost/Servidor/agentesRainbow/index.php/agentes/tony tony is an argument My actual .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /Servidor/agentesRainbow/ #'system' can be replaced if you have renamed your system folder....

Rails routing: optional id for update and destroy actions

In our application we need to have some non standard routes. How can I make router to forward all delete requests to #destroy action even if their is no id parameter in URL? Example: DELETE /users/:user_id/follows/(.:format) {:action=>"destroy", :controller=>"followings"} ...

Routing problem with calling a new method without an ID

I'm trying to put together a form_tag that edits several Shift objects. I have the form built properly, and it's passing on the correct parameters. I have verified that the parameters work with updating the objects correctly in the console. However, when I click the submit button, I get the error: ActiveRecord::RecordNotFound in Shif...

How do I add an additional route?

Here is my default route. context.MapRoute( "CreditReview", "Site/{sitecode}/CreditReview/{controller}/{action}/{id}", new { action = "Index", id = "" } ); I'm looking to add 'status'. This is what I currently have and it isn't working. I haven't worked with routes before so I'm sorry if this is an easy question to answer. context....

HtmlHelper Getting the route name

Hi, I've created a html helper that adds a css class property to a li item if the user is on the current page. The helper looks like this: public static string MenuItem( this HtmlHelper helper, string linkText, string actionName, string controllerName, object routeValues, object htmlAttributes ) { string currentControllerName = ...

ASP.NET MVC Route Contraints with {ID}-{Slug} Format

I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page routes.MapRoute( "Layout", // Route name "layout/{id}-{slug}", // URL with parameters new ...