-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Used string interpolation in notes_controller #11489
Conversation
Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #11489 +/- ##
=======================================
Coverage 83.33% 83.33%
=======================================
Files 93 93
Lines 5772 5772
=======================================
Hits 4810 4810
Misses 962 962
|
@TildaDares hi, I just created this request but it is saying I have some issues. how do I fix it? |
app/controllers/notes_controller.rb
Outdated
@@ -470,11 +470,13 @@ def new_note | |||
end | |||
|
|||
def new_preview_note | |||
Node.new_preview_note(uid: current_user.uid, | |||
Node.new_preview_note( | |||
+ uid: current_user.uid, |
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.
+ uid: current_user.uid, | |
uid: current_user.uid, |
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.
Same with this.
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.
Hello, am I understanding that the problem here is that I have to delete one space and bring it forward?
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.
@IdayatSanni The issue is that you added the plus sign in the code.
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.
@IdayatSanni There was a missing quotation mark.
app/controllers/notes_controller.rb
Outdated
@@ -273,7 +273,7 @@ def update | |||
if request.xhr? | |||
render plain: "#{@node.path(format)}?_=#{Time.now.to_i}" | |||
else | |||
redirect_to URI.parse(@node.path(format)).path + '?_=' + Time.now.to_i.to_s | |||
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i} |
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.
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i} | |
redirect_to "#{URI.parse(@node.path(format)).path}?_=#{Time.now.to_i}" |
Hello, thank you for the review. I will work on it |
Hello @TildaDares I have made corrections but it is still showing issues. What exactly am I doing wrong please? |
app/controllers/notes_controller.rb
Outdated
location: params[:location]) | ||
Node.new_preview_note( | ||
+ uid: current_user.uid, | ||
title: params[:title], |
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.
unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion
parameter, under AllCops
)
app/controllers/notes_controller.rb
Outdated
Node.new_preview_note( | ||
+ uid: current_user.uid, | ||
title: params[:title], | ||
body: params[:body], |
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.
unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion
parameter, under AllCops
)
app/controllers/notes_controller.rb
Outdated
+ uid: current_user.uid, | ||
title: params[:title], | ||
body: params[:body], | ||
main_image: params[:main_image], |
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.
unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion
parameter, under AllCops
)
app/controllers/notes_controller.rb
Outdated
title: params[:title], | ||
body: params[:body], | ||
main_image: params[:main_image], | ||
location: params[:location] |
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.
unexpected token tLABEL
(Using Ruby 2.5 parser; configure using TargetRubyVersion
parameter, under AllCops
)
Co-authored-by: Tilda Udufo <[email protected]>
Code Climate has analyzed commit ec9da4b and detected 0 issues on this pull request. View more on Code Climate. |
This pull request generated screenshots of many common pages in the running app. You should be able to download and view them here: |
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.
Amazing work @IdayatSanni. Thank you!!
Congrats on merging your first pull request! 🙌🎉⚡️ Help others take their first stepNow that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌 https://code.publiclab.org Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕 People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉 Read about how to help support another newcomer here, or find other ways to offer mutual support here. You can also join our Gitter channel to connect with other contributors 📥 |
Congratulations on merging your PR @IdayatSanni 🎉 |
Thank you @TildaDares! I appreciate the guidance. |
Fixes #11446
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
@publiclab/reviewers
for help, in a comment below