search for: name_prefix

Displaying 15 results from an estimated 15 matches for "name_prefix".

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/:request_id", :name_prefix =>...
2006 Dec 17
2
Route generation and clash prevention
Let''s say you''re building a movie rental website. You have customers, movies, and rentals to manage. REST style urls might look like this: /customers/4 /movies/15 /rentals You''d probably also want administrators to be able to view all of the rentals done by a particular customer, and other similar details: /customers/4/rentals /movies/15/rentals /rentals/529/customers
2007 Sep 04
7
1.05 to 1.08
Hi We are looking at moving a project over from 1.05 to 1.08 but have a problem with some of our helper specs They work fine in 1.05 but error in 1.08 and it is the calls to route helper methods that seems to be the problem. I did some playing around .. because the code being tested is reasonably large etc ... but this sample (using the peepcode app) seems to boil down the problem
2007 Oct 28
2
failing test with nested controller routes
...ups/4 Completed in 0.02443 (40 reqs/sec) | DB: 0.00034 (1%) | 302 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
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'' should be successful'' No route matches {:action=&gt...
2007 May 02
4
Shared Nested Resources
The skinny is that I''m attempting to add "Discussions" as resources under different resources ("Groups", "Projects", for example) and I''ve simply hit a roadblock (or two). Discussions are an association between the "discussable" (Group, Project, etc.) and a "Topic" so: class Discussion < ActiveRecord::Base belongs_to :topic
2011 Mar 02
0
polymorphic_path not getting generated
...t get generated. How do I make sure that school_forum_topic_path function call gets generated to return the right path? In other words, how do you generate a multilevel polymorphic path? Savage Beast plugin adds the following to the routes.rb # Savage beast routes BEGIN map.resources :posts, :name_prefix => ''all_'', :collection => { :search => :get } map.resources :forums, :topics, :posts, :monitorship %w(forum).each do |attr| map.resources :posts, :name_prefix => "#{attr}_", :path_prefix => "/#{attr.pluralize}/:#{attr}_id" end map.re...
2006 Aug 14
1
Rest, routes, path_prefix and default params
...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. map.home '''', :controller => ''companies'',:action => ''index'' map.connect '':controller/:action/:id'', :id => nil, :actio...
2006 Oct 28
5
Seperate admin and public views using one controller REST CRUD
Hello, I want to seperate my admin and public views but only use one controller. How to seperate layouts ist clear but how can I tell the controller to render the *.rhtml files in views/admin/ when logged in or render the *.rhtml files in views/public/ (for example). Thanks for any help! PS: using REST and CRUD in edge rails --~--~---------~--~----~------------~-------~--~----~ You received
2007 Aug 25
4
REST routes :has_many , new style
I am trying to write a nested route ''new style'' map.resources :franchises, :has_many => :documents in place of the : map.resources :franchises do |franchises| franchises.resources :documents, :name_prefix => "franchise_" end but get an error : no route found to match "/franchises/1/documents" with {:method=>:get} running rake routes, cannot see it... what could be the problem with my Rail install ? thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~...
2008 Jan 21
7
undefined method error
Hello everyone, I am following the Practical Rails: Social Networking sites book. In chapter 7 photo gallery I am getting a NoMethodError in Pages#show Showing layouts/_menu.rhtml where line #12 raised: undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c> Extracted source (around line #12): 9: <% if is_logged_in? %> 10:
2007 Jul 12
0
routing question
...? eg: r.resources :posts # for the public r.resources :admin_posts # for the admin section It would be nice to simply have a namespace, such as in rails where I''d so something like: r.resources :posts, :path_prefix => "admin", :controller => "admin/products", :name_prefix => "admin" However, it doesn''t look like to me like merb is setup for anything like that right now. How are current users doing this kind of routing? Is there a reason against this that I haven''t thought of or listened to yet? Perhaps a better way? Thanks for y...
2007 Jun 22
1
nested rest URL => passing param from select
Hi, I''m trying to create a select box with an onchange event. When onchange is fired, I want to redirect to a nested rest url. The problem is that I don''t know how to pass the selected value to the url: <select id="category" onchange=" <%= remote_function(:url => category_articles_path(selected value?) ) %> "> Any suggestions? -- Posted
2008 Oct 14
4
replace_html not working
hallo, everyone can anybody help me? i did add my code under ENGINES as a module in a project. before the change , all worked . and the differenz between both is only about application''s environment, before is Ruby version 1.8.6 (i486-linux) RubyGems version 1.1.1 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2
2007 Feb 20
1
Urls generated by nested map.resources
Hi, Apologies if this has been answered before. I have just started to try out the new RESTful routes. For resources that aren''t related to anything else, everything makes sense - for resources with relationships, I am less certain of what the "right" thing to do - especially in relation to the urls produced, and how to modify those urls. For example, if I have teams and