Hi,
I’ve got the following code in my attempt to provide the subject
functionality, lines 20-29 in view:
<%= image_tag "DownArrow.jpg" options =
{ onclick=page[“vendor_droplist”].show } %>
<%= select_tag “test”,
options_for_select(@current_vendors.collect { |v|
v.nickname }),
{:multiple => true} %>
Until I put in the options on image tag and added the div, this code
display a list of vendor nicknames. Now I have several problems:
- Syntax error in line 20 where an identifier was encountered where a
right-paren was expected (see below) - I don’t know how to make the vendor_droplist initially hidden
I’ve Googled for “Rails Ajax toggled item” and got a number of hits
but no apparent answer. I’ll keep poking around the Web, but I
appreciate some suggestion(s).
Thanks in advance,
Richard
Showing app/views/expenses/new.html.erb where line #20 raised:
compile error
K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/views/expenses/
new.html.erb:20: syntax error, unexpected tIDENTIFIER, expecting ‘)’
@output_buffer.concat " "; @output_buffer.concat(( image_tag
“DownArrow.jpg” options =
{ onclick=page[“vendor_droplist”].show } ).to_s);
@output_buffer.concat “\n”
^
K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/views/expenses/
new.html.erb:20: odd number list for Hash
@output_buffer.concat " "; @output_buffer.concat(( image_tag
“DownArrow.jpg” options =
{ onclick=page[“vendor_droplist”].show } ).to_s);
@output_buffer.concat “\n”
^
Extracted source (around line #20):
17:
18: <%= f.label :vendor %>
19: <%= f.text_field :vendor %>
20: <%= image_tag “DownArrow.jpg” options =
{ onclick=page[“vendor_droplist”].show } %>
21:
22:
23: <%= select_tag “test”,
Trace of template inclusion: app/views/expenses/new.html.erb
RAILS_ROOT: K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS
Application Trace | Framework Trace | Full Trace
K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/views/expenses/
new.html.erb:59:in compile!' K:/_Projects/Ruby/_Rails_Apps/_EIMS/RTS/app/controllers/ expenses_controller.rb:30:in
new’