Skip to content

Instantly share code, notes, and snippets.

@Parashar-xx
Created January 21, 2011 10:02
Show Gist options
  • Save Parashar-xx/789495 to your computer and use it in GitHub Desktop.
Save Parashar-xx/789495 to your computer and use it in GitHub Desktop.
delete method
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