Displaying 20 results from an estimated 7000 matches similar to: "RESTful Routing: Getting names of resources out of paths"
2007 May 31
4
Sample Merb App
I put together a sample app to help people learn Merb:
http://svn.depixelate.com/applications/invoice_tracker/
I also blogged about it here:
http://depixelate.com/2007/5/31/taking-merb-for-a-spin
--
Zack Chandler
http://depixelate.com
2009 Dec 03
2
Dynamic Paths
Hey there,
I''m in the muck of a major rails project, and need a bit of advice. Google
isn''t much help in this case, so I came here.
I''m trying to set up a URL structure as follows:
url.com/username/blog/post_id
where the user has_many posts and the post belongs_to user. I''m using the
friendly_id plugin to enable easy lookup with the user''s username,
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
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
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 =>
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog.
map.resources :posts do |posts|
posts.resources :comments, :trackbacks
end
Now comments are at /posts/:post_id/comments.
Okay but what if I want to list all the comments for all the posts. It
should be at /comments, but that isn''t map that way. Can I map comments
twice?
--
Posted via http://www.ruby-forum.com/.
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 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
2006 Jul 22
12
Community request - can someone show me REST?
I mentioned this in another thread, but I''ve got a formal request now.
After reading tons of stuff about REST, I don''t really get it. I
need to see an example.
I''d like someone to write up an example blog app with these requirements
- RESTful using the simply_restful plugin (or edge rails)
- allows posting of comments to articles
- has categories for posts
No need
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
2009 Oct 05
4
Friendly_id and Rake problem.
Hello there,
The plugin friendly_id (http://github.com/norman/friendly_id) has rake
tasks that you can call.
I''m using this plugin as a gem.
I''m trying this: rake friendly_id:make_slugs MODEL=Post
and it is rising this error: Don''t know how to build task
''friendly_id:make_slugs''
So the question is: how do I call a gem''s rake task?
David
2007 Jan 31
1
RESTful Resources/ Caching Issue?
Hi,
I just ran into a bizarre problem when I put my site into production.
I have a resource (call it xxx), then I created with the generate
script.
I then set up page caching on the show action. But now in the
production environment, trying to call the edit action results in the
show page being retreived from the cache.
I''m assuming this has to do with the similarity of the URL
2006 Sep 17
0
[RFC] Nested Restful Resources + Polymorphic Associations
hi,
how to handle the problem addressed in this thread:
http://rails.techno-weenie.net/question/2006/9/6/nested-restful-resources-polymorphic-associations
is there any consensus on this? any comments, suggestions?
thanks,
_c
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
2009 Mar 08
2
RESTful nested resources and polymorphism?
With ref to my previous post: http://www.ruby-forum.com/topic/180356
I am now able to access items from topics controller. However, now I
need to add sub-item e.g.: An item itself could have many sub-items. So
my items model is like:
class Item < ActiveRecord::Base
validates_uniqueness_of :title, :scope => [:topic_id]
validates_presence_of :topic_id, :title, :owner, :position
2006 Apr 21
3
rjs in multiple ajax page
Sorry for the long explanation but I''m having trouble integrating rjs into my
form page. Here''s my page:
<div id="posts">
<ul id="post_list"><%= render :partial => ''list_results'', :collection =>
@posts %></ul>
<p><%= link_to_remote(''+'',
:url => {:action =>
2009 Feb 19
0
friendly_id / acts_as_referenced conflict?
Hi,
I''m using acts_as_referenced to generate unique references:
# property.rb
class Property < ActiveRecord::Base
acts_as_referenced :referenced_column => "permalink"
end
I would now like to use friendly_id to create seo friendly URLs instead
of using the id.
I now have:
# property.rb
class Property < ActiveRecord::Base
acts_as_referenced :referenced_column =>
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 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
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"