Displaying 20 results from an estimated 20000 matches similar to: "Rails 2.0 map.namespace and path_prefix"
2007 Aug 17
0
map.with_options :path_prefix => ''
Hello,
I am getting a ''No route matches'' error in rspec with routes that have a
path_prefix composed by map.with_options. Rails recognizes the routes just
fine and the site works, but I can''t get the specs to pass unless I put the
prefix in each individual route. Any help is appreciated.
My foo model has a polymorphic owner which is what I want the path_prefix to
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 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 =>
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:
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
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"
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
2007 Feb 05
0
How do I use a RESTful helper with path_prefix?
Once upon a time I had this in my routes.rb:
map.client_home '':client/'', :controller => ''orders'', :action =>
''new''
All orders must be scoped within a client name, so this worked quite
well. I used a before_filter to scoop up the @client object by doing
a find_by_name.
Then I decided to expose the OrderController as a fully restful
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 =>
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
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 Oct 01
1
I18n.with_options bloc executed TWICE
Hi, to avoid putting the whole locale scope on every I18n.t call I''m
trying to use a scope, as stated in the doc
(http://guides.rubyonrails.org/active_support_core_extensions.html#with_options)
I tried with
<%= I18n.with_options :locale => :en, :scope => ''portal.visitor_menu'' do
|i18n|%>
Try <%= i18n.t :fav_songs %>
<% end %>
But it produce
2009 Dec 06
9
Route error to Admin namespace
Hi.
I have some apps that i have "admin" areas to the clients manager the app.
This "admin" is a directory on my controllers path, like this:
my_site
--> app
-->-->controllers
-->-->-->admin
And my controllers in "admin", i use the correct namespace(example for
clients_controller):
class Admin::ClientsController < AdminController
Only doing
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
2006 May 24
2
named routes confusion
Hi,
I''m trying generate a URL from a named route like: namedroute_url(params...)
but the generated route is always coming out as the first match from the routes table.
The named route is defined inside a map.with_options block, but that shouldn''t matter should it?
dorian
--
--
I do things for love or money
2006 Mar 23
10
Domain Requirements in Routes (Edge Rails)
I saw on the bottom of the following page that you can route requests to
different controllers based upon which subdomain is being requested.
http://wiki.rubyonrails.com/rails/pages/Routes
with_options :requirements=>{:subdomain=>''first.com''} do
map.connect '''', :controller => "first/catalog"
map.connect ''featured'',
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
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
2006 Apr 04
1
subdomain routing
According to the wiki (http://wiki.rubyonrails.org/rails/pages/Routes)
you can handle subdomain routing in routes.rb. Like this:
with_options :requirements=>{:subdomain=>''first.com''} do
map.connect '''', :controller => "first/catalog"
map.connect ''featured'', :controller => "first/catalog",
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