Skip to content

Conversation

@tofoli
Copy link

@tofoli tofoli commented Apr 19, 2017

Ignores line breaks and whitespace

Ignores line breaks and whitespace
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rafaelfranca
Copy link
Member

Thank you for the pull request but why would we do that?

@chancancode
Copy link
Member

@rafaelfranca I think the is probably motivated by the same thing as #62, but I don't think this is the proper solution, as it doesn't handle the "interior" whitespace

@rafaelfranca
Copy link
Member

👍

@wnm
Copy link

wnm commented Apr 20, 2017

@chancancode maybe .gsub(/\s+/, ' ') instead of .strip then?

@tofoli
Copy link
Author

tofoli commented Apr 20, 2017

My field textarea f.textarea assembles the value with a line break at the beginning, for example

<Textarea>
My Value <textarea>

When doing the validation he was comparing "\nMy Value" == "My Value". With .split remove this line break so the information stays the same

@jduff
Copy link
Contributor

jduff commented Jul 8, 2020

With #84 merged I think it covers the case this PR was for, please give master a try and see if there were any cases missed!

@tofoli tofoli closed this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants