similar to: Adding a global path prefix in routes

Displaying 20 results from an estimated 8000 matches similar to: "Adding a global path prefix in routes"

2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list, In the app we are making we have a rout something like this: map.resources :projects do |projects| projects.resources :pages, :controller =>"Wiki::Pages", :path_prefix => "/projects/:project_id/ wiki", :name_prefix => "project_wiki_" end But I can''t get RSpec(I''m very new to it) to accept this. It keeps throwing errors:
2008 Jun 11
1
Resourse route in namespace with prefix error
Ok so I have this route map.namespace :trades do |trades| trades.resources :buys, :path_prefix => ''/trades/:contract_id'' end I want the contract_id variable to filter a list of buys then I try to open this route http://localhost:3000/trades/1/buys I get a strange error: ActionController::RoutingError in Trades/buys#index Showing trades/buys/index.html.erb where line
2007 Sep 18
2
Making attachment_fu polymorphic
I am working on a small model mixin called attachment_kung to make attachment_fu polymorphic, so you no longer need a different table and Model class for every associated attachment (Productimage, Ad_doc, etc). All you really need is one model and table to handel all your attachments - in some cases, anyway. I have the code working, but have run into one small hitch that I can''t seem to
2006 Aug 14
1
Rest, routes, path_prefix and default params
I am trying to use routes with default params to have routes ''/mycompany/departments'' and ''/companies/1/departments'' mean the same thing (both restful routes). When I set up the files as below, I get an error of ''Couldn''t find Company without an ID'' and my log file shows the following .. Processing DepartmentsController#index (for
2007 Sep 25
2
attachment_fu default path
Hi all. I''ve done a little google search, but doesn''t find anything (with "attachment_fu default path") that could help me in changing attachment_fu''s default path. My model: [audio.rb] has_attachment :max_size => 20.megabytes has_attachment :content_type => "audio/mpeg" has_attachment :storage => :file_system
2009 Jul 30
4
attachment_fu + :path_prefix
Hello friends, I have a query like I am using a attchment_fu to store images. But the i don''t want to store to the default path let say :path_prefix => ''public/uploads'' i want a dyname path for e.g :path_prefix => ''public/#{ current_user.id}'', So just wanted to know how can i say images to the dynamic location. Regards Abhishek Shukla
2007 Oct 28
2
failing test with nested controller routes
I have googled and browsed through spec-users archives, but didn''t find anything different. I used rspec scaffold command to generate a mvc for groups, I used nested controller so I could have a separate interface for admin. the specs are the same as generated, so I won''t post the whole thing. I did put the nested routes names on the calls to the name routes: it
2007 Dec 14
2
Rails 2.0 map.namespace and path_prefix
Hi! I''m trying set up new routing in rails 2.0 and have 1 problem map.namespace :admin do |admin| admin.resources :permissions, :path_prefix => ''/:lang'' end i want have addres like this: http://site.com/en/admin/permissions also i tested: map.with_options :path_prefix => ''/:lang'' do |lang| lang.namespace :admin do |admin|
2007 Feb 07
3
Upgrade to Rails 1.2.2 : RESTful routes not working anymore
Hello, I just upgraded my app to Rails 1.2.2. My routes are : map.with_options :path_prefix => "/admin", :name_prefix => "admin_" do |m| m.resources :requests, :controller => "admin/requests", :collection => { :destroy => :delete, :search => :post } do |request| request.resources :histories, :path_prefix =>
2012 Oct 06
1
how to scope the /auth/:provider/callback , using OmniAuth for users and members
I have two separate groups of people authenticated w Devise , but in this case I cannot used the Devise embedded OmniAuth support. So i am using directly the OmniAuth gem. Initialized w : Rails.configuration.middleware.use OmniAuth::Builder do ..provider :twitter, .. end It''s running fine , but I have an issue with the callback route mapping : I tried match
2010 Dec 27
4
Crazy routes
Hello! I''m using restful_authentication and I would like to have diferent views for logged users and not logged users. Logged users can edit and create items, and not logged user could only list items and show its features. In my routes file I have: map.namespace :admin do |admin| map.resources :items, :controller => "admin/items", :path_prefix =>
2009 Apr 21
3
attachment_fu giving problem on production
Hello friends, I have configured attachment_f. It''s working fine on Local(development) system but giving problem on production. Basically on production the attachment_fu is not able to generate thumbnail image it saving the original size image. Below is the configuration. has_attachment :content_type => :image, :storage => :file_system, :max_size
2008 Jan 29
4
map.resources for controllers in a module
Hello- I''m giving RESTful development a shot. I''m running into some difficulty with controller I have grouped into modules. Specifically, I have a "admin" module with a "user" controller (created with "generate controller admin/user"). I managed to get map.resources wired up with this code: map.resources Admin::User, :path_prefix =>
2009 Nov 10
10
Un-recognised routes that do exist, using namespaces & subdomain checking
I''m getting really cheesed off with RSpec not matching some of my routes when controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, and work fine via HTTP requests . The really annoying thing is it''s working fine for routes that aren''t at the root of the namespace. E.g. say I have
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
Hi guys! ;) If you set "routes.rb" as: map.resources :pocoyo You have RESTful rails routes facilites. Ok, let''s focus on these two maps: "http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller and "index" action. "http://domain.com/pocoyo" [POST] is mapped to "pocoyo" controller and "create"
2009 Dec 06
2
Error in eval(expr, envir, enclos) : object 'N' not found
I'm running an LSODA to generate some graphs, but I need to stop at a certain point and use those values to generate another LSODA output. This is working fine, but when I try to run the second LSODA, I get the "Error in eval(expr, envir, enclos) : object 'N' not found". Any ideas what can be causing this? I have no object 'N' anywhere in the script. I made an
2008 Apr 26
0
Routing: Language as first part of path, for just about everything
Hi Group Like others before me have posted to the group, I am trying to implement routes that have language as the first part of the path, without having to rewrite just about every url generating statement across the codebase (my own, plugins, tests, etc). Let''s start with an example: map.login ''/:lang/login'', :controller => ''sessions'', :action
2006 Jul 19
2
SimplyRestful bug?
Hi I have my routes set up like this: map.resource :contact, :path_prefix => "/employers/:employer_id" so now when I view all contacts for an employer I go to: /employers/1/contacts That works. On that page, there''s a problem with the routes: new_contact_url translates to: /employers/1/contacts/new ... so that works. But, contact_url(@contact) gives me
2006 Aug 28
1
Nested Resources failing..?
Hey I was wondering if anyone else was having problems with nested RESTful routes such as: map.resources :posts do |posts| posts.resources :comments end ?? It is not working for me, I have to declare it in the old prefix way, and it works fine... map.resource :comments, :path_prefix => ''/posts/:post_id'' Just wondering if others are having the same trouble before I do
2009 Aug 02
2
Multiple app directories
Hi, I''m wondering if there is possibility to make multiple ''apps'' under one Rails Application. That is multiple app directories but sharing the same server, the same configuration, etc. One might be ''admin'' and the other — ''user''.. Some directories (models) might be shared via symlink. The reason is that I don''t want to have