-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
@@ -34,10 +34,26 @@ def update | |||
end | |||
end | |||
|
|||
def show_random_card | |||
@card = Card.random_need_to_review | |||
render 'random_card' |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant self
detected.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant self
detected.
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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
No description provided.