Created
January 21, 2011 10:02
-
-
Save Parashar-xx/789495 to your computer and use it in GitHub Desktop.
delete method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
controller code | |
def destroy | |
puts @params.inspect | |
puts @params[:fbuid].inspect | |
puts Club.find(@params[:fbuid]).inspect | |
Club.find(@params[:fbuid]).destroy | |
redirect_to :action => 'list' | |
end | |
erb code | |
<% @clubs.each do |club| %> | |
<tr> | |
<td><%= club.fbuid %></td> | |
<li><td><%= link_to club.cbname, | |
:controller =>"clubs", | |
:action => "details", | |
:id => club.fbuid %></br></td> | |
<td><%= club.fbname %></br></td> | |
<td><%= link_to "delete",{ | |
:action => 'destroy' , :id =>club.fbuid},:confirm => "are you sure ?", :confirm => "Are you sure ?" %></td> | |
</tr> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment