There doesn''t appear to be a named route for the destroy method. -- Kyle Maxwell _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Of course not, you simply do: DELETE /articles/1 <%= link_to ''Delete'', article_url(@article), :method => ''delete'' %> On 7/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> There doesn''t appear to be a named route for the destroy method. > > -- > Kyle Maxwell > > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > >-- Rick Olson http://techno-weenie.net
What about a confirm delete url with simply_restful?... unfortunately the show mapping already snaps up the :get method... On 7/16/06, Rick Olson <technoweenie@gmail.com> wrote:> Of course not, you simply do: > > DELETE /articles/1 > > <%= link_to ''Delete'', article_url(@article), :method => ''delete'' %> > > On 7/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > There doesn''t appear to be a named route for the destroy method. > > > > -- > > Kyle Maxwell > > > > > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > > > > > > > > > > -- > Rick Olson > http://techno-weenie.net > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
Something like the following, then?
GET /articles/1;confirm
Which you configure by doing:
map.resource :article, :member => { :confirm => :get }
Then, you can get at that URL by invoking confirm_article_url.
Lastly, just make sure your #confirm method has the link to DELETE,
like Rick demonstrated.
- Jamis
On Jul 16, 2006, at 7:15 PM, Zack Chandler wrote:
> What about a confirm delete url with simply_restful?... unfortunately
> the show mapping already snaps up the :get method...
>
> On 7/16/06, Rick Olson <technoweenie@gmail.com> wrote:
>> Of course not, you simply do:
>>
>> DELETE /articles/1
>>
>> <%= link_to ''Delete'', article_url(@article),
:method => ''delete'' %>
>>
>> On 7/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:
>> > There doesn''t appear to be a named route for the destroy
method.
>> >
>> > --
>> > Kyle Maxwell
>> >
>> >
>> > _______________________________________________
>> > Rails-core mailing list
>> > Rails-core@lists.rubyonrails.org
>> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
>> >
>> >
>> >
>> >
>>
>>
>> --
>> Rick Olson
>> http://techno-weenie.net
>> _______________________________________________
>> Rails-core mailing list
>> Rails-core@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails-core
>>
> _______________________________________________
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core
Perfect! Thanks Rick and Jamis. Zack On 7/16/06, Jamis Buck <jamis@37signals.com> wrote:> Something like the following, then? > > GET /articles/1;confirm > > Which you configure by doing: > > map.resource :article, :member => { :confirm => :get } > > Then, you can get at that URL by invoking confirm_article_url. > Lastly, just make sure your #confirm method has the link to DELETE, > like Rick demonstrated. > > - Jamis > > On Jul 16, 2006, at 7:15 PM, Zack Chandler wrote: > > > What about a confirm delete url with simply_restful?... unfortunately > > the show mapping already snaps up the :get method... > > > > On 7/16/06, Rick Olson <technoweenie@gmail.com> wrote: > >> Of course not, you simply do: > >> > >> DELETE /articles/1 > >> > >> <%= link_to ''Delete'', article_url(@article), :method => ''delete'' %> > >> > >> On 7/16/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > >> > There doesn''t appear to be a named route for the destroy method. > >> > > >> > -- > >> > Kyle Maxwell > >> > > >> > > >> > _______________________________________________ > >> > Rails-core mailing list > >> > Rails-core@lists.rubyonrails.org > >> > http://lists.rubyonrails.org/mailman/listinfo/rails-core > >> > > >> > > >> > > >> > > >> > >> > >> -- > >> Rick Olson > >> http://techno-weenie.net > >> _______________________________________________ > >> Rails-core mailing list > >> Rails-core@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails-core > >> > > _______________________________________________ > > Rails-core mailing list > > Rails-core@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >