Permalink
Browse files

Added helper to show div with clear both style code

  • Loading branch information...
Kayne committed Feb 13, 2012
1 parent e73ee65 commit b054e32d33b2f566daaa449d9366bead7dd86b06
@@ -25,4 +25,8 @@ def my_page_entries_info(collection, options = {})
def human_date(date)
date.strftime("%d-%m-%Y o %H:%M")
end
+
+ def clear_both
+ "<div style='clear: both;'></div>".html_safe
+ end
end
@@ -5,12 +5,12 @@
- @assigments.each do |a|
- count = count + 1
- if count > 4
- %div{:style => "clear: both;"}
+ = clear_both
- count = 0
%div{:class => "books_show"}
%strong= link_to a.user.username, :controller => "/profiles", :action => "show", :id => a.user.username
%br/
= link_to image_tag(a.user.avatar.url(:thumb), :class => "glow"), {:controller => "profiles", :action => "show", :id => a.user.username}
- %div{:style => "clear: both;"}
+ = clear_both
- else
%p Nikt nie posiada tej książki.
@@ -10,13 +10,13 @@
- @paginate.each do |b|
- count = count + 1
- if count > 3
- %div{:style => "clear: both;"}
+ = clear_both
- count = 0
%div{:class => "books_show"}
%strong= link_to b.title, {:action => "show", :id => b.slug }
%br/
= link_to image_tag(b.photo.url(:thumb), :class => "glow"), {:action => "show", :id => b.slug }
- %div{:style => "clear: both;"}
+ = clear_both
%br/
%br/
%p= paginate @paginate
@@ -5,7 +5,7 @@
- @books.each do |b|
- count = count + 1
- if count > 3
- %div{:style => "clear: both;"}
+ = clear_both
- count = 0
%div{:class => "books_show"}
%strong= link_to b.book.title, :action => "show", :id => b.book.slug
@@ -15,7 +15,7 @@
%br/
= link_to image_tag(b.book.photo.url(:thumb), :class => "glow"), {:action => "show", :id => b.book.slug }
%br/
- %div{:style => "clear: both;"}
+ = clear_both
%br/
%br/
%p= link_to "Wróć na główną", :controller => "books"
@@ -9,13 +9,13 @@
- @paginate.each do |u|
- count = count + 1
- if count > 4
- %div{:style => "clear: both;"}
+ = clear_both
- count = 0
%div{:class => "books_show"}
%strong= link_to u.username, {:action => "show", :id => u.username }
%br/
= link_to image_tag(u.avatar.url(:thumb), :class => "glow"), {:action => "show", :id => u.username }
- %div{:style => "clear: both;"}
+ = clear_both
%p= paginate @paginate
%br/
%br/
@@ -6,13 +6,14 @@
- @assigments.each do |a|
- count = count + 1
- if count > 4
- %div{:style => "clear: both;"}
+ = clear_both
- count = 0
%div{:class => "books_show"}
%strong= a.book.title
%br/
= link_to image_tag(a.book.photo.url(:thumb), :class => "glow"), :controller => "/books", :action => "show", :id => a.book.slug
- %div{:style => "clear: both;"}
+ = clear_both
+ %div
= link_to "Pokaż wszystkie opinie tego użytkownika", {:action => "opinions", :id => @user.id}, :remote => true, :"data-update" => "opinions"
#opinions
= link_to "Powrót do listy użytkowników", {:action => "index"}

0 comments on commit b054e32

Please sign in to comment.