Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple trainer #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Simple trainer #5

wants to merge 9 commits into from

Conversation

ventskus-roman
Copy link
Owner

No description provided.

@@ -34,10 +34,26 @@ def update
end
end

def show_random_card
@card = Card.random_need_to_review
render 'random_card'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

redirect_to root_path
else
flash.now[:error] = "Не правильно"
render 'home/random_card'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -46,4 +57,9 @@ def find_card
@card = Card.find(params[:id])
end

private
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep a blank line before and after private.

end

def strip_whitespaces
self.original_text = self.original_text.strip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хаунд


def strip_whitespaces
self.original_text = self.original_text.strip
self.translated_text = self.translated_text.strip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хаунд

def check_card_params
params.require(:card_translation).permit(:original_text)
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at class body end.

def check_card_params
params.require(:card_translation).permit(:original_text)
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at class body end.

@@ -1,4 +1,6 @@
class HomeController < ApplicationController
def index
@card = Card.need_to_review.first
render 'random_card'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не, тут явно вьюха должна остаться в app/views/home/random_card.html.erb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants