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
1.9.3-p0 :001 > Product.last | |
Product Load (1.2ms) SELECT "products".* FROM "products" ORDER BY "products"."id" DESC LIMIT 1 | |
=> #<Product id: 1, user_id: nil, department_id: nil, asset_id: nil, price: nil, description: nil, keywords: nil, created_at: "2012-10-09 13:29:25", updated_at: "2012-10-09 13:29:25", title: "Hello"> | |
1.9.3-p0 :002 > search = Product.search do | |
1.9.3-p0 :003 > fulltext "Hello" | |
1.9.3-p0 :004?> end | |
=> <Sunspot::Search:{:fq=>["type:Product"], :q=>"Hello", :fl=>"* score", :qf=>"keywords_text title_text description_text", :defType=>"dismax", :start=>0, :rows=>30}> | |
1.9.3-p0 :005 > search.results | |
Product Load (0.8ms) SELECT "products".* FROM "products" WHERE "products"."id" IN (1) | |
=> [#<Product id: 1, user_id: nil, department_id: nil, asset_id: nil, price: nil, description: nil, keywords: nil, created_at: "2012-10-09 13:29:25", updated_at: "2012-10-09 13:29:25", title: "Hello">] |
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
geocoded_by :full_address | |
def full_address | |
country + " " + city + " " + street | |
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
%img.webshrinker{:src => "http://www.webshrinker.com/thumbnails/show/key:50751d71d3051/size:xlarge/url:#{@department.homepage}"} |
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 can? :manage, department | |
.language | |
= department.language | |
= link_to("Edit",edit_department_path(department), :class => "options") | |
| | |
= link_to("Delete",department, :method => :delete, :data=>{:confirm => 'Are you sure?'}, :class => "options") |
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
Started DELETE "/admin/departments/3?locale=lv" for 213.226.141.140 at 2012-11-08 07:44:22 +0100 | |
Processing by Admin::DepartmentsController#destroy as HTML | |
Parameters: {"authenticity_token"=>"TH7mxPzf3lKsfR7AXKNNWWH0diQL74A0KWmXH/br8hI=", "locale"=>"lv", "id"=>"3"} | |
Completed 500 Internal Server Error in 45ms | |
NoMethodError (undefined method `destroy' for nil:NilClass): | |
app/controllers/admin/departments_controller.rb:66:in `destroy' |
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
Sent mail to [email protected] (54ms) | |
Rendered static_pages/contacts.html.haml within layouts/application (6.8ms) | |
Completed 500 Internal Server Error in 70ms | |
ActionView::Template::Error (undefined method `file' for nil:NilClass): | |
23: - for member in @company_members | |
24: .company-member | |
25: .image | |
26: = image_tag(member.assetimage.first.file.url) | |
27: .name-surname |
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
ActionView::Template::Error (uninitialized constant ActionView::CompiledTemplates::Iso3166): | |
47: = image_tag("bullet-drop.png") | |
48: .selectOptions | |
49: - @header_search_countries.each do |country| | |
50: %span.selectOption{:value => Iso3166.localize(country), "data-country"=> country} | |
51: = Iso3166.localize(country) | |
52: .search | |
53: = form_tag(search_departments_path, :method => :get) do | |
app/views/layouts/_header.html.haml:50:in `block in _app_views_layouts__header_html_haml__3447680631664877753_58989880' | |
app/views/layouts/_header.html.haml:49:in `each' |
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
require 'mime/types' | |
# | |
# Built with massive inspiration (ok, more like following their lead) from the following: | |
# - https://github.com/JackDanger/file-uploader/commit/03ed9ba68d46805e22a0014ac0eee9ecbd5acd8d | |
# - https://github.com/newbamboo/example-html5-upload/blob/master/lib/rack/raw_upload.rb | |
# | |
class RawFileUpload | |
def initialize(app) | |
@app = app |
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#link_to_principles{:href => "#principles"}= t("agree_to_these_principles") | |
%div{:style => "display:none"} | |
#principles | |
.block-margin#our-vision | |
%h3 | |
= t("static_pages.vision.our-values") | |
%p | |
%strong= t("seven_columns") | |
%ol |
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 User < ActiveRecord::Base | |
attr_accessible :name | |
has_many :activities | |
def activities_for(day) | |
activities_hash = activities.where( | |
["created_at > ? AND created_at < ?", | |
day.at_midnight, | |
day.end_of_day] |