Displaying 20 results from an estimated 20000 matches similar to: "non-RESTful action or nested routes?"
2006 Oct 16
0
Restful routes, not repeating yourself and non-standard rest actions best practices
So I''ve recently started playing with the restful routes support in
edge rails, converting a few of my controllers to support all the
standard operations.. One thing that''s been bothering me, however, is
the following:
Before using restul routes, I would define an edit method in my
controller which would be responsible for both creating new objects as
well as editing
2009 Feb 20
1
RESTful Routes not working - Switches ID and Action
Hi,
I would like to ask for some suggestions on my problem with Routes. It''s
probably pretty simpel.
This link:
<%= link_to image_tag("...", :alt => "...", :title => "..."),
edit_brand_path(brand) %>
Results in this URL:
http://localhost:3000/brands/21/edit
And echos this:
"Unknown action - No action responded to 21"
When I type
2007 Sep 22
1
Testing RESTful routes
Hi all,
The app I am making right now uses restful routing entirely. I want to
prevent people from accessing my actions without the proper HTTP verb so
I commented out the :controller/:action/:id catch all routes that were
used in pre-RESTful Rails apps. Like so:
#map.connect '':controller/:action/:id.:format''
#map.connect '':controller/:action/:id''
2007 Jul 28
0
Nested RESTful Routes and creating a object from XML
I am trying to create a new model from XML that contains has a has_many
relationship. Is this possible without having to write code to parse
the XML or to doing multiple POSTS? I can do a post with XML that
doesn''t contain any of the has_many elements and it works fine. It is
when I add the items from the has_many relationship that I get a bunch
of errors.
Here are the examples I am
2007 Oct 26
0
Composite Keys on RESTful Routes
I am building an app with existing controllers/actions, using
traditional rails routes. I recently started moving over to RESTful
routes and have hit a snag. Now I am reconsidering my whole effort
and may go back to the original, more flexible, map.connect method.
My problem is, one of the resources has composite keys. The keys are
both strings as well, and can include dots. Here''s
2007 Mar 09
1
Specifying RESTful Routes
What would be the proper way to specify this route?
ActionController::Routing::Routes.draw do |map|
map.resource :recipes
end
Would the specification go into recipes_controller_spec? Also, what
methods are available for testing RESTful routes (i.e. GET, POST, PUT,
DELETE)?
2007 Sep 04
2
specing helpers fails on restful routes
Hi,
I am trying to spec helper methods in a Rails project, but it seems
the specs fail with the error:
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
if the restful routes helper are used either in spec files, or the helper file.
What can I be doing wrong? Or how can I fix this.
Thanks!
--
Surendra Singhi
http://ssinghi.kreeti.com,
2006 Aug 30
0
Rubyists of Second Life Meeting on RESTful Routes | 08/31/2006
The virtual user group Rubyists of Second Life will meet this Thursday,
August 31, and next Thursday, September 7, at 6:00 pm PST.
This Thursday, Theodore Polonsky will be presenting on simply_restful
and the new RESTful routes in Rails Core, and Polypus Watts will be
presenting on DRP: evolutionary/social programming for
interactive/design tasks in Ruby.
Second Life is a virtual 3D world and
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi,
how is it possible that I can use the restful routes helpers (e.g.
new_user_path) in controller specs? I browsed the source code but I
couldn''t find the magic. I''m just curious and would appreciate any
hint...
thanks
Andi
2007 Jan 16
2
RESTful routes and Mime::Type
Hi all
I''m using RESTful routes combined with the to_csv plugin and would
like to know if there''s a nicer way of generating a link to fetch the
CSV file than just making a hard link. This is what I use for the
moment (and it works btw):
<%= link_to("Export as CSV","/companies.csv") -%>
I would expect the link helper to have something like
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:
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
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 =>
2006 Aug 02
1
Use Non CRUD with Simply RESTful
Hey guys,
I''m trying out the new RESTful bits in Edge Rails, and am having a bit
of trouble wrapping my brain around certain things. For instance, say I
have a page that is separated into sections with tabs at the top. I want
to replace divs on the page with RJS.
Now typically before I''d have a method on the controller that rendered
an RJS template to accomplish this.
2008 Mar 24
2
link_to_remote and restful routes/urls
is there a way to access a restful resource with mike''s new
link_to_remote helper?
something like:
<%= link_to_remote h(user.name),
:update => "div_id",
:url => user_url(user) %>
of course, that doesn''t work.
i have also been trying things like:
:url => controller.asset_host +
2010 Aug 06
1
RESTful routes and verify :method
If my application is using RESTful routing, does using
"verify :method" in controllers become redundant?
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2007 Jan 05
2
Using RESTful routes in controller tests
Why can''t I use the RESTful route helpers in my specs?
In my controller I''m doing a redirect: redirect_to list_path(:id =>
@item.list_id)
Now when I write: controller.should_redirect_to list_path(:id => 2)
I''m getting the following error:
NoMethodError in ''POST on /lists/2/items should redirect to index on
succesful POST''
You have a nil object
2008 Aug 27
6
Restful routes
Hi, I''m pretty new to the concept of restful routing and am struggling
to find any rails 2 info that helps with what I''m looking for.
I have a regular scaffold setup and the routes are setup as default
map.resources :pages
I would like to be able to use titles in the url rather than relying on
the id.
Eg
localhost:3000/pages/sometitle
instead of just
localhost:3000/pages/1
2007 Dec 05
7
Better RESTful routes with fb_sig_request_method
With the new fb_sig_request_method provided by Facebook, I''ve patched
shanev''s pseudo-resource routes to generate restful routes, minus some
exceptions.
The announcement: http://www.facebook.com/developers/message.php#msg_126
Patch is submitted here: http://rubyforge.org/tracker/index.php?func=detail&aid=16105&group_id=4187&atid=16132
Blog entry about it:
2008 Oct 18
0
Link_to + PUT + restful routes problem
Hi,
I''m trying to use link_to to access the Update action + add some extra
parameters. I''m using the default rest routes.
I can''t get it working.
When I use: <%= link_to '' Accept'', invitation_path, :method => :put, :id
=> ''1'', :command => ''accept'' %>
I can get into the Update action but the