Skip to content

Instantly share code, notes, and snippets.

View edison's full-sized avatar
🏠
Working from home

Edison Machado edison

🏠
Working from home
View GitHub Profile
@edison
edison / pjax.rb
Created May 19, 2011 07:27
Pjax with ruby 1.8.7
module Pjax
extend ActiveSupport::Concern
included do
layout lambda {|c| c.pjax_request? ? false : 'application' }
end
private
def redirect_pjax_to(action, url = nil)
new_url = url_for(url ? url : { :action => action })
@edison
edison / gist:980092
Created May 19, 2011 02:53
pjax syntax error
edison$ rails s
/Users/edison/.rvm/gems/ruby-1.8.7-p334/gems/pjax-rails-0.1.1/lib/pjax-rails.rb:1:in `require': /Users/edison/.rvm/gems/ruby-1.8.7-p334/gems/pjax-rails-0.1.1/lib/pjax.rb:5: syntax error, unexpected '>' (SyntaxError)
layout ->(c) { pjax_request? ? false : 'application' }
^
/Users/edison/.rvm/gems/ruby-1.8.7-p334/gems/pjax-rails-0.1.1/lib/pjax.rb:5: syntax error, unexpected '{', expecting kEND
layout ->(c) { pjax_request? ? false : 'application' }
^
/Users/edison/.rvm/gems/ruby-1.8.7-p334/gems/pjax-rails-0.1.1/lib/pjax.rb:5: syntax error, unexpected '}', expecting kEND
/Users/edison/.rvm/gems/ruby-1.8.7-p334/gems/pjax-rails-0.1.1/lib/pjax.rb:10: odd number list for Hash
new_url = url_for(url ? url : { action: action })
@edison
edison / gist:980015
Created May 19, 2011 01:58
Sass::SyntaxError when using CSS "alpha-opacity" property
Sass::SyntaxError in Main/cockpit#index
Showing /Users/edison/Sites/beta.foco/app/views/layouts/application.html.haml where line #8 raised:
Invalid CSS after "...: alpha(opacity": expected comma, was ":0);"
Extracted source (around line #8):
5: %meta{'http-equiv' => 'Content-language', 'content' => I18n.locale}
6: %meta{'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'}