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 facebook_account | |
u = self.user | |
link = "https://facebook.com/#{u.facebook}" | |
ActionController::Base.helpers.link_to("<i class='fa fa-facebook'></i>".html_safe, link, target: "_blank", class: "social-solo facebook") if (!(u.nil?) && !(u.facebook.nil?) && !(u.facebook.empty?) && u.show_facebook?) | |
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
form do |f| | |
f.semantic_errors *f.object.errors.keys | |
f.inputs "Details", :class => "collapsible" do | |
f.input :title | |
f.input :author, :label => "Name" | |
f.input :is_private | |
f.input :publish_date, :as => :datepicker | |
f.input :publish_frequency, :as => :number, :label => "Publish Frequency", :step => 1 | |
#TODO: add slug again. Also, understand why this was removed | |
f.input :slug, :placeholder => "cannot be changed afterwards" unless !f.object.slug.nil? |
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
mystring = "Charles Dickens first serialised <i>Great Expectations</i> to rave reviews in 1859 and its wit, power and brilliance is just as fresh today. You may have read this story of first love and lost identity before, but not like this.<br>" | |
#In my view: - content_for :og_description = mystring | |
#in my layout.haml: %meta{content: CGI.unescapeHTML(strip_tags(yield(:og_description)))} |
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
has_one :splash_page, :dependent => :destroy | |
accepts_nested_attributes_for :splash_page, :allow_destroy => true, reject_if: proc { |attributes| !SplashPage.new(attributes).valid? } |
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
a { | |
color: blue; | |
@media (max-width:100){ | |
color: red; | |
} | |
} | |
b{ | |
@extend a; | |
} |
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
computeElementsPositions = () -> | |
elements = new Array() | |
padding = parseInt $('body').css('paddingTop') | |
console.log 'computing elements with body padding of '+padding | |
$('.witness').remove() | |
$('[data-pid]').each () -> | |
$this = $(this) | |
pid = $this.attr("data-pid") | |
pos = $this.offset().top - padding | |
witness = $('<div class="witness">' + pid + ':' + pos + '</div>') |
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
- @price_present = true | |
%span{"ng-cloak" => true, "ng-switch" => "currency"} | |
%span.animated{"ng-switch-when" => 'gbp'}= number_to_currency(locals[:gbp].to_d/100, {:unit => @currencies['gbp']}) | |
%span.animated{"ng-switch-when" => 'eur'}= number_to_currency(locals[:eur].to_d/100, {:unit => @currencies['eur']}) | |
%span.animated{"ng-switch-when" => 'usd'}= number_to_currency(locals[:usd].to_d/100, {:unit => @currencies['usd']}) |
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
1) WebReadsController when the book is published and the user is subscribed should display only published chapters | |
Failure/Error: get :show, id: @book | |
ActionController::UrlGenerationError: | |
No route matches {:id=>"slug_32", :controller=>"web_reads", :action=>"show"} | |
# ./spec/controllers/web_reads_controller_spec.rb:20:in `block (4 levels) in <top (required)>' |
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
/Users/Gaston/dev/pigeonhole/pigeonhole/spec/support/controller_macros.rb | |
/Users/Gaston/dev/pigeonhole/pigeonhole/spec/support/count_queries.rb | |
/Users/Gaston/dev/pigeonhole/pigeonhole/spec/support/delayed_jobs.rb | |
/Users/Gaston/dev/pigeonhole/pigeonhole/spec/support/rspec_extensions.rb | |
/Users/Gaston/dev/pigeonhole/pigeonhole/spec/support/stub_paperclip_attachment.rb | |
Run options: include {:locations=>{"./spec/controllers/send_to_kindle_controller_spec.rb"=>[41]}} | |
F | |
Failures: |
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
include ActionDispatch::TestProcess | |
Fabricator(:chapter) do | |
body "Chapter Body" | |
tile_title "hello" | |
tile_description "" | |
tile_extra_html "" | |
file {fixture_file_upload(Rails.root + 'spec/fabricators/assets/chapter.rtf')} | |
end |