Skip to content

Instantly share code, notes, and snippets.

<%= javascript_include_tag :defaults %>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js?load=effects,slider"></script>
<%= javascript_include_tag 'rails' %>
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="pACcWm38PxTmGUoz2bSmKIzIwpEmqCJDTH6xe2="/>
<%= link_to_remote "Vote Yes", :method=> :post, :update=>"widget#{widget.id}", :url => {:controller=>"widgets", :action => 'vote',:id=>widget,:vote=>true},
:complete => visual_effect(:highlight, "widget#{widget.id}", :duration=>1.5, :startcolor=>"#3aed11"), :html => {:class=>"yes-btn"} %>
<%= link_to "Vote Yes", {:controller=>"widgets", :action => 'vote',:id=>widget, :vote=>true}, :remote=> true, :class=>"yes-button" %>
$("widget<%[email protected]%>").update("<%=@text%>");
new Effect.Highlight("widget<%[email protected]%>", {duration: 1.5, startcolor: "<%=@start_color%>"});
location /widgets/new_feature {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
}
# Lock the whole app
ApplicationController < ActionController::Base
lock
end
# Lock specific controller/actions
ApplicationController < ActionController::Base
lock :actions=>["widgets#new","widgets#index"]
end
LOCK_PATH = File.dirname(__FILE__) + "/lock"
require "#{LOCK_PATH}/engine.rb"
require "lock"
require "rails"
module Lock
class Engine < Rails::Engine
end
end