I'm trying to call a part of the display in Rails view
I'm really in trouble without getting a syntax error
It's a view called
<% def check_label (id, label)%> <input type = "checkbox"> <label for = "<% = id%>"><% = label%></label> <% end%> <% def check_list (label, values)%> <div> <a data-toggle = "collapse" data-parent = "# condition" href = "#<% = label%>s"> <label><% = t (label)%></label> </a> <div> <% for v in values do%> <div> <% = check_label (label + '_' + v, t (label + 's.' + v))%> </div> <% end%> </div> </div> <% end%>
<% = check_label (label + '_' + v, t (label + 's.' + v))%>
Syntax error, unexpected',&apos ;, expecting')'
I'm sorry for the low level questions
Just one line of syntax error doesn't tell you why for over 30 minutes ...
Answer # 1
check_label (label +'_'+ v, t (label +'s.'+ v))
I'm sorry, in the first place, it wasn't a matter of arguments in this way.
What was supposed to be an argument was not even an argument.
No space is required between the method and the argument.
First of all, no such argument can be specified.
def foo (hoge, huga) p hoge p huga end foo ("aaa" + "bbb", 'ccc')
I think you should try and prepare this method appropriately.
foo ("aaa" + "bbb", 'ccc')
You can't do it without space. If you write like this, you should use
Second, regarding errors that can occur after this, since
vis an Integer type, it cannot be combined with a String type and
- i want to fix a syntax error in ruby on rails
- ruby on rails - /app/models/orderrb:2: syntax error, unexpected':', expecting end belongs_to: address ^ send data to db
- ruby on rails - i want to use yield in a method chain
- ruby - about rails error
- i get the error "chmod on/mnt/code " when rails new [ubuntu, ruby on rails 52]
- ruby - rails heroku deploy error
- ruby - rails name error cannot be resolved
- ruby on rails - how to resolve undefined method `errors' for nil:nilclass
- [ruby on rails] i want to add a word to the error message
- ruby on rails - when using cloud9, an error about insufficient space is displayed and the terminal does not work
- ruby - i get an error when rails edit is
- ruby on rails 6 - i got a nomethod error
- ruby on rails - rails app routing error deployed on aws
- the ruby on rails each method does not repeat well
- ruby on rails - an error occurs when implementing the follow function with rails
- ruby on rails - i want to put jquery for bootstrap 4 in rails 6 but i get an error
- ruby on rails - i get an error saying "activerecord :: recordnotfound in messagescontroller # index" "couldn't fi
- displaying error messages in ruby on rails validation
- [ruby on rails] activerecord::recordnotfound error is displayed even though params have arrived
- ruby - rails console error
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved