search for: path_prefix

Displaying 20 results from an estimated 48 matches for "path_prefix".

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 --~--~---------~--~----~------------~-------~--~----~ You received...
2007 Sep 18
2
Making attachment_fu polymorphic
...up your life. ################################### USE ####################################################### ## To setup Attachment_kung, ## 1. Create the Attachment_fu model and table (I used Attachment and attachments), ## set them up for polymorphism. Add to the table a column called path_prefix. ## (I used: belongs_to :attachable, :polymorphic => true for the model and attachable_type and ## attachable_id for the table); and configure the Attachment_fu model with ## has_attachment :storage => :file_system ## include Attachment_kung ## Make sure Attac...
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: ActionController::RoutingError in ''Wiki::PagesController POST ''create''...
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| admin.resources :permissions end end its still not map http:...
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
...t''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" action. if you adds ":path_prefix" as: map.resources :pocoyo, :path_prefix='':country'' You have the same RESTful rails routes faicilites, but with non correct behavior on POST calls: "http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller and "index" action. &quo...
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 represent, so m...
2007 Feb 05
0
How do I use a RESTful helper with path_prefix?
...x'' map.resources :orders but I still needed orders to be prefixed with the /:client in the url; so this matched everything up: map.client_home '':client/'', :controller => ''orders'', :action => ''index'' map.resources :orders, :path_prefix => '':client/'' and in fact it works when I test through a browser, but not in my test code: def test_client_orders get orders_url(:client => ''myclient'') assert_response :success end results in this: NoMethodError: You have a nil object when y...
2006 Aug 14
1
Rest, routes, path_prefix and default params
...d88710b06b66529459bc8c9c625109fc Parameters: {"action"=>"index", "controller"=>"departments"} How can I use restful routes with default parameters? ***** routes.rb ******* ActionController::Routing::Routes.draw do |map| map.resources :departments, :path_prefix => ''mycompany'',:company_id => 1 map.resources :companies do |companies| companies.resources :departments do |departments| departments.resources :departments, :name_prefix => ''child_'' end end # Install the default route as the lowest priority...
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 => "/admin/requests...
2012 Oct 06
1
how to scope the /auth/:provider/callback , using OmniAuth for users and members
...''users/ omniauth_callbacks#create'' match ''/members/auth/:provider/callback'', to: ''members/ omniauth_callbacks#create'' but the provider ( fb , twitter, google) claimebd about the callback uri : "/auth/:provider/callback" .. as the path_prefix (:path_prefix => "/auth" ) is set in the initializer , I have no mean to modify it dynamically... any clue ? or feedback from previous experiences... thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post...
2009 Apr 21
3
attachment_fu giving problem on production
...has_attachment :content_type => :image, :storage => :file_system, :max_size => 500.kilobytes, :thumbnails => {:thumb => ''170x60>''}, :processor => ''Rmagick'', :path_prefix => ''public/store_images'' Is any idea what can be an issue? Regards Abhi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to...
2007 Aug 22
8
How to spec an attachment_fu model
First off, I''m not trying to spec attachment_fu, I know it''s been tested. But, I added some code to that model that I do need to test. Basically, I need to somehow fulfill the "uploaded_data" property so I can actually run my tests(otherwise they fail because of validations). The "uploaded_data" field is what would grab the multipart data from form. Here
2008 Jan 29
4
map.resources for controllers in a module
...unning 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 => "/admin" I''m not sure if that''s the right way, but it seems to work. The problem I''m running into is with setting up my link_tos. I tried this code: <%= link_to ''Show'', user_path(@user) %> Which failed with a "undefined meth...
2007 Sep 25
2
attachment_fu default path
...ent_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 has_attachment :path_prefix => "public/files [/audio.rb] But all my files go on been uploaded to public/files/0000/00[last inserted id]/my_file_name.ext. What am I missing? I want that all my files go to public/files. Thank you very much amd sorry my poor english. -- Davi Vidal -- E-mail: davividal-UiHwsRqXct...
2007 Oct 28
2
failing test with nested controller routes
...02 Found [http://127.0.0.1/admin/groups] it works... so the route works.. but not in the test? here''s whats in my routes.rb map.resources :groups, :controller => ''admin/groups'', :name_prefix => "admin_", :path_prefix => "admin" any ideas? the groups_url(id) is the only route that is failing in the test. thanks :) -- http://rubygeek.com - my blog featuring: Ruby, PHP and Perl http://DevChix.com - boys can''t have all the fun
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)...
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 some digging around.. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group....
2008 Jan 02
0
why does rails keep prompting me for post?
...#39;password_confirmation'', {}, :size => 45, :class => ''text'' %></td> </tr> </table> <%= submit_tag ''Change password'' %> <%end%> 5) wrote my routes.rb base = ''/v1'' map.resources :users, :path_prefix => base, :member => {:change_password => :get, :change_password_update => :put} do |users| users.resources :orders, :path_prefix => ''/v1/users/:permalink'' end 6) got this error when i tried to attempt to change my password and press the submit button no rou...
2008 Jul 25
1
Adding a global path prefix in routes
I''m having some trouble figuring out how to add a path prefix to _all_ paths in a site. I see the option to use :path_prefix when using resources, but this isn''t exactly what I want. I would simply like to add a static prefix of /events/foo/ to all paths, including the root url (for now, until I create a proper events controller). I attempted to do this using map.root but it looks as though this is not the cor...
2005 Jan 06
0
skip unconnected interfaces
...7,7 @@ static char do_not_config; static unsigned int default_caps = CAP_DHCP | CAP_BOOTP | CAP_RARP; static int loop_timeout = -1; +static int only_connected = 0; static int configured; struct state { @@ -290,6 +291,38 @@ return ret; } +static int ulong_from_sys_device_file(const char *path_prefix, + const char *dev_name, + const char *dev_file, + unsigned long *val) +{ + char t[PATH_MAX], p[255]; + int i, fd, rc = -1; + + i = snprintf(t, PATH_MAX-1, "%s/%s/%s", path_prefix, dev_name, dev_file); + if (i < 0 || i >= PATH_MAX-1) + goto done; + t[i] =...