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 IndexController < ApplicationController | |
def index | |
if current_user | |
if !current_user.cards.empty? | |
@random_card = current_user.due_cards.first | |
elsif current_user.decks.empty? | |
redirect_to new_deck_path, alert: 'Создайте колоду и добавьте карточки' | |
else | |
redirect_to decks_path, alert: 'Добавьте карточки в колоду' |
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 IndexController < ApplicationController | |
def index | |
if current_user | |
if !current_user.cards.empty? | |
@random_card = current_user.due_cards.first | |
card = current_user.cards.find(params[:card_id]) | |
@result = card.check_translation(params[:search]) | |
elsif current_user.decks.empty? | |
redirect_to new_deck_path, alert: 'Создайте колоду и добавьте карточки' |
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
D, [2014-09-07T22:56:09.572244 #37947] DEBUG -- : [1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m | |
Run options: include {:focus=>true} | |
All examples were filtered out; ignoring {:focus=>true} | |
D, [2014-09-07T22:56:09.604782 #37947] DEBUG -- : [1m[35m (0.2ms)[0m BEGIN | |
D, [2014-09-07T22:56:09.611129 #37947] DEBUG -- : [1m[36m (0.2ms)[0m [1mSAVEPOINT active_record_1[0m | |
D, [2014-09-07T22:56:09.611420 #37947] DEBUG -- : [1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1 | |
D, [2014-09-07T22:56:09.611719 #37947] DEBUG -- : [1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m | |
D, [2014-09-07T22:56:09.661679 #37947] DEBUG -- : [1m[35mUser Exists (1.4ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'windsochi@gmail.com' LIMIT 1 | |
D, [2014-09-07T22:56:09.831547 #37947] DEBUG -- : [1m[36mSQL (7.8ms)[0m [1mINSERT INTO "users" ("created_at", "crypted_password", "email", "salt", "updated_at") VALUES ($1, $2, |
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 CardsController < ApplicationController | |
before_action :find_card, only: [:show, :edit, :update, :destroy] | |
def index | |
@cards = current_user.cards | |
end | |
def new | |
@card = Card.new | |
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
macbook15:flashcard_static litos$ rails s | |
=> Booting WEBrick | |
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000 | |
=> Run `rails server -h` for more startup options | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Users/litos/.rvm/gems/ruby-2.1.2/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:237:in `validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError) | |
from /Users/litos/.rvm/gems/ruby-2.1.2/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:261:in `handle_settings' | |
from /Users/litos/.rvm/gems/ruby-2.1.2/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/core/service.rb:98:in `new' | |
from /Users/litos/.rvm/gems/ruby-2.1.2/ruby/2.1.0/gems/fog-core-1.24.0/lib/fog/storage.rb:26:in `new' |
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
macbook15:flashcard_static litos$ bundle install | |
Fetching gem metadata from https://rubygems.org/........ | |
Fetching additional metadata from https://rubygems.org/.. | |
Using rake 10.3.2 | |
Using i18n 0.6.11 | |
Using minitest 4.7.5 | |
Using multi_json 1.10.1 | |
Using thread_safe 0.3.4 | |
Using tzinfo 0.3.41 | |
Using activesupport 4.0.2 |
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
macbook15:flashcard_static litos$ gem install nokogiri -v '1.6.3.1' | |
ERROR: Loading command: install (LoadError) | |
dlopen(/usr/local/Cellar/ruby/2.1.2_2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method | |
Referenced from: /usr/local/Cellar/ruby/2.1.2_2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle | |
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib | |
in /usr/local/Cellar/ruby/2.1.2_2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - /usr/local/Cellar/ruby/2.1.2_2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle | |
ERROR: While executing gem ... (NoMethodError) | |
undefined method `invoke_with_build_args' for nil:NilClass |
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
macbook15:flashcard_static litos$ bundle install | |
Fetching source index from https://rubygems.org/ | |
Using rake 10.3.2 | |
Using i18n 0.6.11 | |
Using minitest 4.7.5 | |
Using multi_json 1.10.1 | |
Using thread_safe 0.3.4 | |
Using tzinfo 0.3.41 | |
Using activesupport 4.0.2 | |
Using builder 3.1.4 |
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
Running `rake db:migrate` attached to terminal... up, run.5112 | |
Migrating to CreateCards (20140722155038) | |
== CreateCards: migrating ==================================================== | |
-- create_table(:cards) | |
-> 0.0335s | |
-- add_index(:cards, :user_id) | |
PG::UndefinedColumn: ERROR: column "user_id" does not exist | |
: CREATE INDEX "index_cards_on_user_id" ON "cards" ("user_id") | |
rake aborted! | |
StandardError: An error has occurred, this and all later migrations canceled: |
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 Notebook | |
@@notebooks_count = 0 | |
attr_accessor :notebook | |
def self.count | |
@@notebooks_count | |
end | |
def add_note(note) | |
notebook.push(note) |