work on controllers/views started

This commit is contained in:
albert
2010-03-11 19:42:04 -05:00
parent ac98d7db37
commit 15c134b270
34 changed files with 720 additions and 7543 deletions

View File

@@ -1,12 +1,12 @@
module ApplicationHelper
def nav_link_to(text, options, html_options = nil)
if options[:controller] == params[:controller] || (%w(tag_alias tag_implication).include?(params[:controller]) && options[:controller] == "tag")
def nav_link_to(text, url, html_options = nil)
if url.include?(params[:controller]) || (%w(tag_alias tag_implication).include?(params[:controller]) && url =~ /\/tag/)
klass = "current-page"
else
klass = nil
end
%{<li class="#{klass}">} + fast_link_to(text, options, html_options) + "</li>"
(%{<li class="#{klass}">} + link_to(text, url, html_options) + "</li>").html_safe
end
def format_text(text, options = {})
@@ -22,7 +22,7 @@ module ApplicationHelper
def tag_header(tags)
unless tags.blank?
'/' + Tag.scan_query(tags).map {|t| link_to(h(t.tr("_", " ")), posts_path(:tags => t)}.join("+")
'/' + Tag.scan_query(tags).map {|t| link_to(h(t.tr("_", " ")), posts_path(:tags => t))}.join("+")
end
end