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
module ApplicationHelper | |
# thanks to http://blog.phusion.nl/2011/08/14/rendering-rails-3-1-assets-to-string/ | |
# you may need to change the owner of the tmp/cache/* directories to the web servers user | |
# e.g. for Debian systems: `chown -R www-data:www-data tmp/cache/*` | |
def render_asset(asset) | |
Conferator::Application.assets.find_asset(asset).body.html_safe | |
end | |
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
http://www.kolodvor.net/2010/01/02/rails-csrf-and-ajax-requests/ | |
http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#M000514 | |
http://stackoverflow.com/questions/5241213/rails-session-is-blank-when-using-http-put | |
Key thing is to add form_authenticity_token to path param as a query_string | |
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to | |
<%= link_to 'Reset', null_counter_model_path(model, :authenticity_token => form_authenticity_token), :confirm => 'Are you sure?', :method => :put, :remote => true %> |
NewerOlder