Created
June 14, 2012 09:53
-
-
Save latpaw/2929369 to your computer and use it in GitHub Desktop.
acts as taggable on , delete a tag
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
def remove_tag | |
@project = Project.find(params[:id]) | |
@project.type_list.remove(params[:tag]) | |
@project.save | |
redirect_to projects_path, :flash => { :success => "Updated - tag nuked."} | |
end | |
Updated route: | |
resources :projects | |
match 'projects/:id/remove_tag/:tag' => 'projects#remove_tag' | |
<% project.type_list.each do |tag|%> | |
<div class="p_tag"> | |
<%= tag %> | |
<%= link_to 'x', {:action => "remove_tag", :id => project.id, :tag => tag, | |
:controller => "projects"} %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment