This file contains hidden or 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
# THis is the controller action | |
def first_step | |
@payers = sorted_payers | |
end | |
private | |
def sorted_payers | |
@label1 = Payer.new(name: "<script>$( document ).ready(function() {alert( 'ready!' );});</script>") | |
end |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<objects type="array"> | |
<object> | |
<service-type-code>1</service-type-code> | |
<description>Medical Care</description> | |
<children type="array"> | |
<child>2</child> | |
<child>42</child> | |
<child>45</child> | |
<child>69</child> |
This file contains hidden or 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
############################################ | |
# Application Controller - CanCan | |
############################################ | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
rescue_from CanCan::AccessDenied do |exception| | |
redirect_to root_path, :alert => exception.message | |
end |
This file contains hidden or 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.9.3-p374 :015 > @books = @books.where(['substr(title,1,1) in ?', ('A'..'T').to_a]) | |
Book Load (41.2ms) SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') | |
SQLite3::SQLException: near ",": syntax error: SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') | |
ActiveRecord::StatementInvalid: SQLite3::SQLException: near ",": syntax error: SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') |
This file contains hidden or 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 User < ActiveRecord::Base | |
. | |
. # ... = stuff irrelevant to the problem | |
. | |
has_one :schedule | |
. | |
. | |
. | |
end |
This file contains hidden or 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
Couldn't find all Roles with IDs (5, ) (found 1 results, but was looking for 2) | |
<div id="role-options-<%= user.id %>" class="modal" style="display: none;"> | |
<%= simple_form_for user, :url => user_path(user), :html => {:method => :put, :class => 'form-horizontal' } do |f| %> | |
<div class="modal-header"> | |
<a class="close" data-dismiss="modal">×</a> | |
<h3>Change Role Test</h3> | |
</div> | |
<div class="modal-body"> | |
<%= f.input :role_ids, :collection => Role.all, :as => :check_boxes, :label_method => lambda {|t| t.name.titleize}, :label => false, :item_wrapper_class => 'vertical', checked: user.role_ids %> |
NewerOlder