similar to: Singular resources namespaced by its slug (Routing)

Displaying 20 results from an estimated 20000 matches similar to: "Singular resources namespaced by its slug (Routing)"

2008 Oct 09
0
How to consume a nested singular resource?
Hi, We have a RESTful server application which exposes the following routes using the following rules, but when trying to consume those resources from a client application the routes are not generated correctly. And we are not sure how to get around that. The routes.rb specifies the following resources: ActionController::Routing::Routes.draw do |map| map.resources :users do |user|
2006 Jan 31
4
Rails bug? Conditions on associations ignored by eager loading
I''m looking for someone to confirm the following as a bug in Rails 1.0 before I post it to Trac. If I use eager loading on an association that has conditions defined, the conditions are ignored. The following example illustrates the problem. I have two tables: create_table "blogs", :force => true do |t| t.column "name", :string end create_table
2006 Oct 07
3
blog_id magic with typo
Hi All, I am modifying typo so as, I can host multiple blogs on the same typo. And its almost done, except that...i am stuck at one place. When a user posts a new article, depending upon current blog_id, I would like to set the blog_id attribute of @article object. So..in the admin/content_controller.rb: We have: def new_or_edit if request.post? set_article_author
2010 Mar 27
2
Shorter Rails 3 routes
Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command produce the following lines: GET /categories/:category_id/articles/:article_id/comments(.:format)
2009 Mar 13
2
ruby capitalizing singular version of route
Hi All, I''ve searched on this topic and can''t seem to find anyone results saying others have had the same problem, so hope someone here can help. if in routes, I map addresses: map.resources :addresses If get the following routes: addresses new_Address edit_Address Note that the singular routes (new, edit) are capitalized. to prove the issue, in console, I can type: >>
2009 Oct 19
3
routing namespaced controllers
Hi, I have one controller in the /app/controllers/animals_controller.rb directory, and another in /app/controllers/production/services_controller.rb. The thing is that one Animal has many Services, and i''d like to access to them using something like: http://localhost:3000/animals/1/production/services/1 or at least with: http://localhost:3000/animals/1/services/1 I tried the last one
2008 Jun 25
0
Rspec routing_spec failing on nested singular resource
This should be easy to solve; I''m trying to get an Rspec routing_spec working with a singular nested resource; map.resources :users do |user| user.resource :profile end All the tests in the profile_routing_spec seem to be failing because they can''t match the routes, for example; # The spec describe ProfileController do describe "route generation" do it
2009 Jul 01
1
form_for resources with :singular specified
I fully suspect that I''m missing the point here somewhere so I promise I won''t be offended if you tell me I''m being daft. My application rents equipment ... not equipments. So I have the following: map.resources :equipment, :singular => :equipment_instance class Equipment < ActiveRecord::Base class EquipmentController < ApplicationController The
2010 Feb 23
0
Naming problem with singular nested resource
Hi all, While reworking my application from Rails 2.3 to 3.0beta I found a small bug in route naming. When nesting singular routes it doesn''t prefix the nested resource with the first resource in naming. I did some debugging and came up with a patch: https://rails.lighthouseapp.com/projects/8994/tickets/3911-naming-problem-in-nested-singular-resource#ticket-3911-2 regards, Jan De
2005 Dec 13
1
slug of zombies
after booting a CentOS 4.2 system I have a bunch of zombies... root 2828 0.0 0.0 0 0 ? Z 14:41 0:00 [chvt] <defunct> My read from googling this is chvt stems from something that involves a shell. They ***may*** have been created from my attempts to start mysqld which isn't working (I will start another thread) but no efforts to kill them off are working...
2008 Jan 15
0
Namespaced routes and js.erb
Whenever I try and use a .js.erb view in my nested routes it tries to look for a layout(i.e. admin.js.erb). any ideas on how to stop this other than calling :layout => false? --~--~---------~--~----~------------~-------~--~----~ 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 Nov 28
1
Cross-compiling asterisk-1.4 for Debian on a slug
Hi folks! I planned to put asterisk-1.4 on my slug (one of these embedded devices). Since i don't want to compile it natively on this slow processor, i need a cross-compile toolchain. I tried out several ways such as manually compiling binutils and gcc, or using scratchbox. All of these with the result that i got binaries for machines except the one i wanted! :( I then have been given a link
2007 Jun 19
1
singular resource paths
I am working on an application where I have the urls setup like this: http://www.foo.com/jdhale where jdhale is the username for the user. I do this with a plugin called resource_hacks. Other than some weird errors when calling some url generator methods on nested resources, this works fine. However, I get the impression that using resource_hacks is no longer necessary. So, my question is
2010 Jan 20
0
How to map a Named Route onto a namespaced resource?
I have a site, where I am currently adding a self-built shop. Among other stuff I have this construction in my route-file map.namespace :shop do |shop| shop.resources :categories do |categories| categories.resources :products end end I like the namespace, since it encapsulates the shop nicely inside my webapplication. Somehow I would like the url "http://mysite.com/shop" to
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2006 Jul 17
2
Trouble with has_one
Hi, I''m trying to write a blog application where each post has a single header image associated. My models: ---------- class Post < ActiveRecord::Base belongs_to :blog has_many :images has_one :header end class Header < ActiveRecord::Base file_column :image_path end class Image < ActiveRecord::Base belongs_to :post file_column :image_path end The controller targets I
2006 May 30
3
Help about CMS - newbie in RoR
Hi team, I''m a very newbie RoR user from Spain and I''m developing a blog''s CMS. Why RoR?, coz I think it''s an amazing framework with many posibilities, portable and really powerful, with a young and optimist community, and taking my project I''ve prefered his structure in front of LAMP. Another thing is that I''ve liked to surprise my masters
2008 May 29
2
Resource routing error with the route equipment/new
I''m having an issue with resource routing after running a "ruby script/generate scaffold equipment" command. I did not make any changes to the equipment model/controller/views after running this. The full command I ran (all one line) ... ruby script/generate scaffold equipment name:string description:text contact:text keywords:string created_at:datetime created_by:integer
2009 Apr 18
1
RESTful Routing: Getting names of resources out of paths
Hello - I''m trying to remain RESTful in a new application that I''m building, but I''m not sure how to get the routes that I want. I''m trying to avoid having resource names like "posts" and "comments" cluttering things up. For example, for a resource that I designate: GET example.com -> index GET example.com/1 -> show, id=1 GET
2005 Dec 18
0
Caching question
I''ve got caching mostly working but it''s acting string with the index/home. On the site I have a redirect the points http://nutritionreality.com at http://nutritionreality.com/home I do this in routes.rb by: map.index '''', :controller => ''home'', :action => ''index'' Caching happens on index (index.html gets created in