In the controller you can redirect_to another action.

On Oct 4, 8:27 am, Presario 6331RSH HAM <[EMAIL PROTECTED]> wrote:
> On Sep 30, 11:48 am, luis tomas <[EMAIL PROTECTED]> wrote:> The delete link 
> in your rhtml should be:
> > <%= link_to 'Delete', @post, :confirm => 'Are you sure?', :method
> > => :delete %>
>
> > It's the same in your index.html.erb
>
> > On Sep 27, 5:11 am, Presario 6331RSH HAM <[EMAIL PROTECTED]> wrote:
>
> Nope! This does not work for my app. I have the delete link in the
> 'show' page.
> I can get it to delete using
> <%= link_to 'Delete',
> Post.find_by_title(params[:id]).destroy,  :confirm => 'Are you sure?'
> %>
> but then I need it to link back to index because this post is no
> longer valid. How could I get this to work?
> It seems that I can do one or the other but not both.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to