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
class FunctionParser | |
def test | |
# How do I access @vals from sim.rb? | |
# puts @vals.inspect | |
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
class ConvertFriendshipTable < ActiveRecord::Migration | |
def change | |
rename_column :friendships, :sender, :user | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>TwitterBootstrapPoc</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> | |
<div class="twitter-flash"> |
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
class UserController < ApplicationController | |
def show | |
flash[:error] = "User ID: #{params[:id]}did not exist" | |
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
<body> | |
<% flash.each do |name, msg| -%> | |
<%= content_tag :div, msg, class: name %> | |
<% end -%> | |
<%= yield %> | |
</body> |
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 BootstrapFlashHelperPatched | |
ALERT_TYPES = [:error, :info, :success, :warning] unless const_defined?(:ALERT_TYPES) | |
def bootstrap_flash_patched | |
flash_messages = [] | |
flash.each do |type, message| | |
# Skip empty messages, e.g. for devise messages set to nothing in a locale file. | |
next if message.blank? | |
type = type.to_sym |
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 BootstrapFlashHelperPatched | |
ALERT_TYPES = [:error, :info, :success, :warning] unless const_defined?(:ALERT_TYPES) | |
def bootstrap_flash_patched | |
flash_messages = [] | |
flash.each do |type, message| | |
# Skip empty messages, e.g. for devise messages set to nothing in a locale file. | |
next if message.blank? | |
type = type.to_sym |
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
> | |
%3E | |
> | |
> | |
> | |
> | |
> | |
> | |
> | |
> |
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
class ApplicationController < ActionController::Base | |
ensure_authorization_performed :except => [:index, :search], :if => :auditing_security?, :unless => :devise_controller? | |
private | |
def auditing_security? | |
Rails.env != 'production' | |
end | |
# Send 'em back where they came from with a slap on the wrist | |
def authority_forbidden(error) |
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 protect_from_forgery(options = {}) | |
self.request_forgery_protection_token ||= :authenticity_token | |
prepend_before_filter :verify_authenticity_token, options | |
end | |
def verify_authenticity_token | |
unless verified_request? | |
logger.warn "WARNING: Can't verify CSRF token authenticity" if logger | |
handle_unverified_request | |
end |
OlderNewer