This file contains hidden or 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
| # Method borrowed from deprecated Rails Inflector class | |
| def ordinalize(number) | |
| if (11..13).include?(number.to_i % 100) | |
| "#{number}th" | |
| else | |
| case number.to_i % 10 | |
| when 1; "#{number}st" | |
| when 2; "#{number}nd" | |
| when 3; "#{number}rd" | |
| else "#{number}th" |
This file contains hidden or 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
| <%= f.error_messages %> | |
| <p> | |
| <%= f.label :name %><br /> | |
| <%= f.text_field :name %> | |
| </p> | |
| <p> | |
| <%= f.label :permalink %><br /> | |
| <%= f.text_field :permalink %> | |
| </p> | |
| <p> |
This file contains hidden or 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
| rake production radiant:extensions:aggregation:update --trace | |
| ** Invoke production (first_time) | |
| ** Execute production | |
| ** Invoke environment (first_time) | |
| ** Execute environment | |
| rake aborted! | |
| Don't know how to build task 'radiant:extensions:aggregation:update' | |
| /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1704:in `[]' | |
| /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2026:in `invoke_task' | |
| /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level' |
This file contains hidden or 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
| <% form_for(@event) do |f| %> | |
| <%= f.error_messages %> | |
| <p> | |
| <%= f.label :title %><br /> | |
| <%= f.text_field :title %> | |
| </p> | |
| <p> | |
| <%= f.label :permalink %><br /> | |
| <%= f.text_field :permalink %> | |
| </p> |
This file contains hidden or 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
| <% if address_type == 'billing' %> | |
| <% javascript 'dynamic_billing_states' %> | |
| <% else %> | |
| <% javascript 'dynamic_shipping_states' %> | |
| <% end %> | |
| <table> | |
| <tr> | |
| <td class="left"><%= make_label('Country', true) %> | |
| <td class="right"> |
This file contains hidden or 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
| <script type="text/javascript" charset="utf-8"> | |
| function so_clearInnerHTML(obj) { | |
| // so long as obj has children, remove them | |
| while(obj.firstChild) obj.removeChild(obj.firstChild); | |
| }; | |
| // create the anchor | |
| eAnchor<%= image.id %> = document.createElement("a"); | |
| eAnchor<%= image.id %>.setAttribute("href", "#{image.file.url(:original)}"); | |
| eAnchor<%= image.id %>.setAttribute("id", "project_main_image_anchor"); |
This file contains hidden or 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
| link_to_function((image_tag image.file.url(:thumb)), project, image, :id => "project_main_image_anchor") do |page| | |
| page[:main_image_wrapper].replace_html ('<a href="' + image.file.url(:original) + '" id="project_main_image_anchor" title="' + project.title + '" rel="shadowbox">' + (image_tag image.file.url(:medium), :title => "Click to enlarge.") + '</a>') | |
| end |
This file contains hidden or 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
| Loading development environment (Rails 2.2.2) | |
| /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError) | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/completion.rb:10 | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:252:in `require' | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:252:in `load_modules' | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:250:in `each' | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:250:in `load_modules' | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:21:in `setup' | |
| from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb.rb:54:in `start' | |
| from /usr/bin/irb:13 |
This file contains hidden or 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 change_main_image | |
| project = Project.find(params[:id]) | |
| image = Image.find(params[:image_id]) | |
| render :partial => 'main_image', :locals => {:project => project, :image => image} | |
| end | |
| def sort_images | |
| @project = Project.find(params[:id]) | |
| @project.images.each do |image| | |
| # we must add one to compensate for the zero based index. |
This file contains hidden or 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 if_old(date) | |
| "class_name_here" if !date.nil? && date < Date.today | |
| end |