Nice to meet you.I'm a beginner at ruby.
I am trying to create a web system using ruby on rails.
There was an error that could not be resolved, so I would like to ask you a question.
in the controller class you created
String type string retrieved from DB using ransack
I want to split using split method, but I can't do it well.
The error message is as follows:
undefined local variable or method `"' for #
<HogeController:0x007f9529648cf8>
The source code is as follows:
def index
@q = Hoge.search (params[:q])
@[email protected](distinct:true)
@hoges.each do|a|
str=a.hogestr.to_s.split(",")
end
end
Thank you for your cooperation.
ruby-on-rails ruby
This is because the ", "
double quotation marks are not ASCII "
.
You can erase ", "
and re-enter ", "
.
© 2024 OneMinuteCode. All rights reserved.