Hi,
I have model with custom primary key:
document.rb
class Document < ActiveRecord::Base
set_primary_key "token"
end
routes.rb:
MyApp::Application.routes.draw do
resources :documents, :only => [:index, :show, :create]
end
When i create new document, i get error:
No route matches {:controller=>"documents", :id=>#<Document id:...
Hi guys and girls,
I seem to have a problem fully understanding url routing. Like on an aspx page called News.aspx I want to show the full news listing, on the page News.aspx?view=detail&id=x I want to show the news details. And on the Page News.aspx?view=browse&pageindex=1 I want users to be able to browse to the archives.
So basiclly...
I need your opinion about my graduation project idea,
Using Bluetooth for sending files to remote mobiles by routing on near mobiles with enabled blue tooth and use them as intermediate stations until the sent files reach their destination.
Do you think its feasible and is appropriate for a graduation project?
...
Hi,
I couldn't find any documentation about this around so please help.
I need to localize my web site URLs like the samples below;
website.com/home/about
website.com/anasayfa/hakkinda
also action names will have to be localized as page names;
website.com/AdList/12/Details
website.com/IlanListesi/12/Detaylar
As you see it seem...
I want to create a route something like:
http://images.example.com/[models]/[sizes]_[filename].[extension]
[models] = (blog|event|user)
[sizes] = (t|s|l|o)
[filename] = example
[extension] = (png|gif|jpg)
How do I create the route for this? I've tried the following w/ no success:
Router::connect('/:model/:size\_:filename.:extens...
My site (WebForms, C# 4.0) is using Forms Auth and by default requires login:
<authorization>
<deny users="?"/>
</authorization>
I allow unauthenticated access to the public folder (http://siteurl.com/member/public):
<location path="member/public">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
...
Hi All,
I want to add optional parameters in my routing table.
For example I would like the users to browse a product catalog like this:
http://www.domain.com/browse/by-category/electronics/1,2,3 etc
Now i've created a route like this:
routes.MapPageRoute(
"ProductsBrowse",
"browse/{BrowseBy}/{Categ...
Is it possible to redirect from one controller to another using POST request? redirect_to supports only GET. I found something called "post_via_redirect", but it seems that it was deprecated in Rails 3.
...
I have following in my routes.rb:
namespace "admin" do
resources :categories
end
resources :categories
and all works well. However, as I remove or comment out: "resources :categories" part
namespace "admin" do
resources :categories
end
#resources :categories
I am getting:
ActionView::Template::Error (undefined method `cat...
I have a url that I want to map routing to:
http://siteurl.com/member/edit.aspx?tab=tabvalue
where tabvalue is one of: "personal", "professional", "values" or nothing.
I want to map it to a route like:
Member/Edit/{tab}
But my problem is - I don't know how to specify such constraints. I'm trying this regex:
^[personal|professiona...
I have a problem with routing with an id conditioned by a regex constraint.
My route is:
resources :albums, :constraints => { :id =>/[a-zA-Z\d\.\-\_]+$/ } do
get :offline, :on => :member
end
If I do this:
GET /content/v1/albums/:id(.:format) {:action=>"show", :controller=>"content/v1/albums", :id=>/[a-zA-Z\d\.\-\_]+$/
It w...
Without using a symlink, how can I serve images that are outside of the rails project? I though there might be some routes magic but I can find what I'm looking for...
Lets say images are at ~/images and the application is at ~/app.
...
Greetings,
I am trying to implement a "context" system similar to the one used by GitHub. For example, a Post may be created belonging either to the User or one of the Companies the User belongs to depending on whether to User is in the "User" context or a context that refers to one of the Companies.
As a part of this, I'd like to be a...
Hi. I have this routing.yml:
post:
class: sfDoctrineRouteCollection
options: { model: BlogPost }
I need this url:
/company/24/mycompany/blog/post/13.
How how I can pass to my route 2 models to generate following route:
//Test route example
post_show:
url: /company/:id/:title_slug/blog/post/:post_id
param: { module: c...
Is it possible to use paginator with $_GET parameters?
For example i have a route like this:
$router->addRoute('ajax_gallery',
new Routes_Categories(
'/:lang/:category/age/:dep/:cat/:towns',
array(
"page" => 1,
"dep" => 0,
"cat" => 0,
"towns" => 0
),
array(
"dep" => "[0-9]+",
"cat" => "[0-9]+"
)
));
And i'm making request like this ...
Hi,
I was wondering how to do a redirect in the routes of a cakephp application.
I simply want to redirect on url /xxx to /yyy
I don't want to have to set up a controller or and action in the pages controller just to redirect a url.
Is there a way to do it in the routing?
Cheers.
...
I have a requirement to add specific functionality to an asp.net mvc2 web site to provide addtional SEO capability, as follows:
The incoming URL is plain text, perhaps a containing a sentence as follows
"http://somesite.com/welcome-to-our-web-site" or
"http://somesite.com/cool things/check-out-this-awesome-video"
In the MVC pipeline,...
How can I design my view such that it "remembers" its route? So that "Back" on /team/1/members/1 links to /team/1/members and /members/1 links back to /members?
I have models of team and member. Teams have many members.
My routes allow me to view all member or members on a team.
resources :teams do
resources :members
end
re...
Hi,
I'm doing some changes on my routes, and suddenly the following is appearing in my url's as a querystring:
?RouteValueDictionary=System.Web.Routing.RouteValueDictionary
So, my url's now look like
http://localhost:20367/Search/AdvancedSearchResults?RouteValueDictionary=System.Web.Routing.RouteValueDictionary
How do I make it d...
after debbuging i am getting following url of my webproject:
http://localhost:54594/Home/Home /Home-Controller/Home-Action
http://localhost:54594/AboutUs/AboutUs /AboutUs-Controller/AboutUs-Action
http://localhost:54594/Products/Products /Products-Controller/Products-Action
In my global.asax i ha...