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
-@authors.each_with_index do |author, index| | |
#container{:style=>"float:left;"} | |
.bigsansed="#{link_to author.name, author}" | |
%br/ | |
-@authors.each_with_index do |author, index| | |
#container{:style=>"float:right;"} | |
.bigsansed="#{link_to author.name, author}" | |
%br/ | |
#pagination | |
=will_paginate @posts |
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
/* Change lc_width and rc_width to control column width, and voila */ | |
!lc_width= 140px | |
!rc_width= 180px | |
!lc_p= 10px | |
!lc_pad= !lc_p*2 | |
!rc_p= 10px | |
!rc_pad= !rc_p*2 | |
!lc_full= !lc_width + !lc_pad | |
!rc_full= !rc_width + !rc_pad |
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
.floatleft{:style=>"width:200px;"} | |
-@contacts[0...(@contacts.per_page/2)].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
.floatright{:style=>"width:200px;"} | |
-@contacts[(@contacts.per_page/2)...@contacts.per_page].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
#pagination{:style=>"clear:both;"} | |
=will_paginate |
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
.floatleft{:style=>"width:200px;"} | |
-@contacts[0...(@contacts.per_page/2)].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
.floatright{:style=>"width:200px;"} | |
-@contacts[(@contacts.per_page/2)...@contacts.per_page].each_with_index do |contact, index| | |
=render :partial => "contact", :locals => {:contact => contact} | |
#pagination{:style=>"clear:both;"} | |
=will_paginate |
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
module ApplicationHelper | |
def e_tag(model) | |
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)") | |
end | |
def d_tag(model) | |
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete") | |
end | |
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 show_report_books(book) | |
update_page do |page| | |
page.insert_html :bottom, book.genre.name.capitalize.to_sym, {:partial => 'static_book', :locals=>{:book=>book}} | |
end | |
end |
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
First, install graphviz - http://www.graphviz.org/Download..php -- | |
it is available for multiple platforms and is easy to install. | |
Secondly, run a: | |
1 gem install railroad | |
And Railroad and its dependencies are installed. Railroad is capable of visualizing model relationships, | |
controllers, and more. Check the railroad site at http://railroad.rubyforge.org/ for great examples | |
such as Typo visualized and other sick visualizations. Once you have these installed, |
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
brewery: | |
name:string | |
city:string | |
state:string | |
country:stirng | |
beer_breweries: | |
brewery_id:integer | |
beer_id:integer | |
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
last_tr = TherapistReport.send(:with_exclusive_scope) {TherapistReport.all}.collect{|x| x if (x.report_id == self.report.previous && x.therapist_id == self.therapist_id && x.report.territory_id == self.report.territory_id)}.compact[0] |
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
create_table :jots_notes, :force => true do |t| | |
t.references :jot, :polymorphic => true | |
t.references :note | |
t.timestamps | |
end |
OlderNewer