Created
May 27, 2016 20:11
-
-
Save aya-soft/1e357c0c2334a574d871dab597c1b997 to your computer and use it in GitHub Desktop.
1) Почему comment, а не @comment? Стремись к однообразию!
2) Зачем искать @Spare таким извращенческим способом? Запчасть же у тебя
есть в comment.spare!
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
def update | |
@spare = Spare.find(params[:service_station_comment][:spare_id]) | |
comment = ServiceStationComment.find(params[:id]) | |
if comment.update permit params[:service_station_comment] | |
redirect_to admin_service_station_path(comment.service_station) | |
else | |
render :edit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment