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
it "should be able to be completed if all steps are complete" do | |
@course.steps.delete_all | |
step = FactoryGirl.build(:step) | |
@course.steps << step | |
@user.steps << step | |
@course.completed_by(@user).should == true | |
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
<%= content_for :body_id, "sidebar" %> | |
<div class="menubar"> | |
<div class="sidebar-toggler visible-xs"> | |
<i class="ion-navicon"></i> | |
</div> | |
<div class="page-title course_title"> | |
<% if params[:curriculum_id] %> | |
<% curriculum = @course.curriculums.find(params[:curriculum_id]) %> | |
<a href="/curriculums/<%= curriculum.id %>" data-toggle="tooltip" data-placement="right" title="Back to <%= curriculum.title unless curriculum.blank? %>"><i class="fa fa-arrow-left margin-right-5"></i> </a> |
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
Kibaeks-MacBook-Pro:onvard_saas kibaek$ rails c | |
Loading development environment (Rails 3.2.17) | |
[1] pry(main)> sc = ScormCloud::ScormCloud.new("23Z8XTPJ0Z","xCalRn4voMjyHJGARV2XgZv4cnI2CRDhp1dNTNFYex") | |
=> #<ScormCloud::ScormCloud:0x0000010b5b5b88 | |
@appid="23Z8XTPJ0Z", | |
@secret="xCalRn4voMjyHJGARV2XgZv4cnI2CRDhp1dNTNFYex"> | |
[2] pry(main)> sc.course | |
=> #<ScormCloud::CourseService:0x0000010b5dd7a0 | |
@connection= |
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
# add_column :users, :data_key, :string | |
# add_column :users, :data_value, :string | |
DATA_KEYS = ['vehicle_type', 'city', 'phone_model', 'availability', 'example_customer_service'] | |
DATA_KEYS.each do |method| | |
define_method(method) do | |
find_by_data_key(method).try(:data_value) | |
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
NoMethodError - undefined method `id' for nil:NilClass: | |
app/views/public_activity/email/_scheduler.html.erb:1:in `_app_views_public_activity_email__scheduler_html_erb__606296939798758135_2334328660' | |
actionview (4.1.1) lib/action_view/template.rb:145:in `block in render' | |
activesupport (4.1.1) lib/active_support/notifications.rb:161:in `instrument' | |
actionview (4.1.1) lib/action_view/template.rb:339:in `instrument' | |
actionview (4.1.1) lib/action_view/template.rb:143:in `render' | |
rack-mini-profiler (0.9.2) lib/mini_profiler/profiling_methods.rb:108:in `block in profile_method' | |
actionview (4.1.1) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial' | |
actionview (4.1.1) lib/action_view/renderer/partial_renderer.rb:279:in `block in render' |
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
<%= form_for @syllabus, :html => { :class => "form-horizontal" } do |f| %> | |
<% if @syllabus.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@syllabus.errors.count, "error") %> prohibited this syllabus from being saved:</h2> | |
<ul> | |
<% @syllabus.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
<%= form_tag(import_missions_path, :method => :post, :id => "import-js", :remote => true ) do |f| %> | |
<ul> | |
<% current_user.folders.find_by_order(1).missions.each do |mission| %> | |
<li> <%= check_box_tag "mission_ids[]", mission.id %> | |
<%= mission.id.to_s + ". " + mission.title %> </li> | |
<% end %> | |
</ul> | |
<%= submit_tag "Import ", :class => 'btn btn-primary' %> | |
<% 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 Track < ActiveRecord::Base | |
acts_as_taggable | |
include PgSearch | |
pg_search_scope :search_by_title, :against => :title #:using => [:tsearch => {:prefix => true}], #:trigram, :dmetaphone] | |
pg_search_scope :search_by_weight, | |
:against => { | |
:title => 'B', | |
:description => 'C' |
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 | |
protect_from_forgery | |
#session['user_return_to'] = request.url | |
def after_sign_in_path_for(resource) | |
sign_in_url = "http://localhost:3000/users/sign_in" || "http://onvard.com/users/sign_in" || | |
"http://www.onvard.com/users/sign_in" #url_for(:action => 'new', :controller => 'sessions', :only_path => false, :protocol => 'http') | |
if (request.referer == sign_in_url) |
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 MissionsController < ApplicationController | |
# GET /missions | |
# GET /missions.json | |
before_filter :store_location | |
before_filter :authenticate_user!, :except => [:show, :index] | |
def vote_for_mission | |
@mission = Mission.find(params[:id]) | |
@originalpage = session[:page_a] |
OlderNewer