Skip to content

Commit

Permalink
aatos bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bborn committed Feb 26, 2012
1 parent 88ae14b commit 73051c2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion UPGRADING.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ That's it!
Note: this version adds a counter_cache to taggings, so you may need to update the counter on your existing tags by doing something like:

ActsAsTaggableOn::Tag.all.each do |tag|
ActsAsTaggableOn::Tag.update_counters ActsAsTaggableOn::Tag.id, :taggings_count => ActsAsTaggableOn::Tag.taggings.length
tag.update_counters tag.id, :taggings_count => tag.taggings.length
end

If you have many tags, this could take a while, though.
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ def update
@tag = ActsAsTaggableOn::Tag.find_by_name(URI::decode(params[:id]))

respond_to do |format|
if @ActsAsTaggableOn::Tag.update_attributes(params[:tag])
if @tag.update_attributes(params[:tag])
flash[:notice] = :tag_was_successfully_updated.l
format.html { redirect_to admin_tags_url }
format.xml { render :nothing => true }
else
format.html { render :action => "edit" }
format.xml { render :xml => @ActsAsTaggableOn::Tag.errors.to_xml }
format.xml { render :xml => @tag.errors.to_xml }
end
end
end

def destroy
@tag = ActsAsTaggableOn::Tag.find_by_name(URI::decode(params[:id]))
@ActsAsTaggableOn::Tag.destroy
@tag.destroy

respond_to do |format|
format.html {
Expand Down
11 changes: 6 additions & 5 deletions app/helpers/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,16 @@ def page_title
def add_friend_link(user = nil)
html = "<span class='friend_request' id='friend_request_#{user.id}'>"
html += link_to_remote :request_friendship.l,
{:update => "friend_request_#{user.id}",
{ :update => "friend_request_#{user.id}",
:loading => "$$('span#friend_request_#{user.id} span.spinner')[0].show(); $$('span#friend_request_#{user.id} a.add_friend_btn')[0].hide()",
:complete => visual_effect(:highlight, "friend_request_#{user.id}", :duration => 1),
500 => "alert('"+:sorry_there_was_an_error_requesting_friendship.l.gsub(/'/, "\\\\'")+"')",
500 => "alert('#{escape_javascript(:sorry_there_was_an_error_requesting_friendship.l)}')",
:url => hash_for_user_friendships_url(:user_id => current_user.id, :friend_id => user.id),
:method => :post }, {:class => "add_friend button"}
:method => :post
}, {:class => "add_friend button"}
html += "<span style='display:none;' class='spinner'>"
html += image_tag 'spinner.gif', :plugin => "community_engine"
html += :requesting_friendship.l+" ...</span></span>"
html += image_tag('spinner.gif')
html += "#{:requesting_friendship.l} ...</span></span>"
html.html_safe
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/activities/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
-box do
%h3= :tags.l
- tag_cloud @popular_tags, %w(nube1 nube2 nube3 nube4 nube5) do |tag, css_class|
= link_to ActsAsTaggableOn::Tag.name, tag_path(ActsAsTaggableOn::Tag.to_param), :class => css_class
= link_to tag.name, tag_path(tag.to_param), :class => css_class
%h6.all=link_to :all_tags.l, tags_path

6 changes: 3 additions & 3 deletions app/views/photos/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
%ul.tags
- @tags.each do |tag|
%li
- if (ActsAsTaggableOn::Tag.name.eql?(params[:tag_name]) )
= link_to ActsAsTaggableOn::Tag.name, user_photos_path(@user), :class => "selected"
- if (tag.name.eql?(params[:tag_name]) )
= link_to tag.name, user_photos_path(@user), :class => "selected"
- else
= link_to ActsAsTaggableOn::Tag.name, user_photos_path(:user_id => @user, :tag_name => ActsAsTaggableOn::Tag.name)
= link_to tag.name, user_photos_path(:user_id => @user, :tag_name => tag.name)


#yui-main
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#yui-main
-box :class => "yui-b" do
%h3=:editing_ActsAsTaggableOn::Tag.l
%h3=:editing_tag.l
= form_for(:tag, :url => tag_path(@tag), :html => { :method => :put, :class => "MainForm" }) do |f|

%label
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
-box do
%h3= :browse_content_by_tags.l
-tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class|
=link_to ActsAsTaggableOn::Tag.name, tag_url(ActsAsTaggableOn::Tag.to_param), :class => css_class
=link_to tag.name, tag_url(tag.to_param), :class => css_class
4 changes: 2 additions & 2 deletions app/views/tags/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
- else
= :items_tagged.l
- @tags.each do |tag|
= link_to h(ActsAsTaggableOn::Tag.name), tag_path(tag)
= link_to h(tag.name), tag_path(tag)

-if @related_tags.to_a.size > 0
-box do
%h3.tags=:related_tags.l
-tag_cloud @related_tags, %w(css1 css2 css3 css4) do |tag, css_class|
=link_to h(ActsAsTaggableOn::Tag.name), tag_path(tag), :class => css_class
=link_to h(tag.name), tag_path(tag), :class => css_class

%h6.all= link_to :all_tags.l, tags_path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def button_to_remote(name, options = {}, html_options = {})
# <%= submit_to_remote 'update_btn', 'Update', :url => { :action => 'update' },
# :update => { :success => "succeed", :failure => "fail" }
#
# <tt>options</tt> argument is the same as in form_remote_ActsAsTaggableOn::Tag.
# <tt>options</tt> argument is the same as in form_remote_tag.
def submit_to_remote(name, value, options = {})
options[:with] ||= 'Form.serialize(this.form)'

Expand Down Expand Up @@ -253,7 +253,7 @@ def form_remote_tag(options = {}, &block)
# ...
# <% end %>
#
# If you don't need to attach a form to a resource, then check out form_remote_ActsAsTaggableOn::Tag.
# If you don't need to attach a form to a resource, then check out form_remote_tag
#
# See FormHelper#form_for for additional semantics.
def remote_form_for(record_or_name_or_array, *args, &proc)
Expand Down

0 comments on commit 73051c2

Please sign in to comment.