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 document.file.original_filename.parameterize, {:controller => 'documents', :action => 'show', :args => [:document => document.file.url(:original)]}, :class => 'document' %> |
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
| class Image < Asset | |
| has_attached_file :file, | |
| :styles => { :thumb => '75x75#', :small => '250x250>', :medium => '416x416>', :full => '792x792>' }, | |
| :default_style => :medium, | |
| :url => "/assets/:id/:style/:basename.:extension", | |
| :path => ":rails_root/public/assets/:id/:style/:basename.:extension" | |
| validates_attachment_content_type :file, :content_type => ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'image/gif'] | |
| 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
| categories = Category.find(:all) | |
| categories.each do |category| | |
| if !category[:permalink].nil? | |
| category.update_attribute(:permalink, nil) | |
| end | |
| 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
| a = [1, 2] | |
| b = 'cat' | |
| a.each {|b| c = b * a[1]} | |
| a #=> [1, 2] | |
| b #=> 2 | |
| defined?(c) #=> nil |
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
| total used free shared buffers cached | |
| Mem: 256 251 5 0 0 20 | |
| -/+ buffers/cache: 230 25 | |
| Swap: 511 243 268 |
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 link_to_with_current_class(name, path, cls='current') | |
| current_page?(path) ? (link_to name, path, :class => cls) : (link_to name, path) | |
| 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
| <%= project.images.first ? (link_to_remote (image_tag project.images.first.file.url(:thumb), :title => truncate(project.description)), :url => {:controller => :projects, :action => :change_main, :category_id => category, :project_id => project.id}, :loading => "$('category_#{category.id}_main').hide(); $('spinner').show();", :update => "category_#{category.id}_main", :complete => "$('spinner').hide(); $('category_#{category.id}_main').show(); Shadowbox.clearCache(); Shadowbox.setup();" ) : "" %> |
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
| sudo rake gems:build --trace | |
| (in /home/p/public_html/s/releases/20081220094647) | |
| ** Invoke gems:build (first_time) | |
| ** Execute gems:build | |
| Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rspec-rails-1.1.11' | |
| Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/mislav-will_paginate-2.3.6' | |
| Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/capistrano-ext-1.2.1' | |
| Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rubyist-aasm-2.0.2' | |
| Built gem: '/home/p/public_html/s/releases/20081220094647/vendor/gems/rspec-1.1.11' | |
| rake aborted! |
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
| <div class="asset"> | |
| <% if asset.new_record? %> | |
| <% fields_for "page[new_asset_attributes][]", asset do |asset_form| -%> | |
| <p> | |
| <%= asset_form.file_field :file %> | |
| <%= link_to_function "remove", "$(this).up('.asset').remove()" %> | |
| </p> | |
| <% end -%> | |
| <% else %> | |
| <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
| class PagesController < ApplicationController | |
| before_filter :login_required, :except => [ :show ] | |
| # GET /pages | |
| # GET /pages.xml | |
| def index | |
| @pages = Page.find(:all) | |
| respond_to do |format| | |
| format.html # index.html.erb |