Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:49:04+00:00 2026-06-12T05:49:04+00:00

I’m completing a tutorial on Rails – however the tutorial was written with Rails

  • 0

I’m completing a tutorial on Rails – however the tutorial was written with Rails 2, and as I have Rails 3 I’m having to convert everything over.

I’ve got a Google Map, and when you click on it, you should have a pop-up appear with a new marker and a form for entering the data into. When I click the map, the marker is appearing, but no form for entering data. Any help would be much appreciated!

I’m guessing it has something to do with the ajax?? When I click anywhere on the map to try and enter new data, the web console is giving me a 500 internal server error. No idea where I’m going wrong!

Here’s the controller code for the ‘new’ action:

def new
  @incident = Incident.new

  respond_to do |format|
    format.html {
      @incident.latitude=params['latitude']
      @incident.longitude=params['longitude']
      render :partial=>'new', :locals=>{:incident=>@incident}
    }
    format.xml  { render :xml => @incident }
  end
end

The index view:

<h1>Listing incidents</h1>

<%= render(:partial=>"map", :locals=>{:data=>"/incidents.xml",
  :full_page=>true, :show_action=>'show', :new_action=>'new'}) %>

And the ‘new’ partial:

<h1>New incident</h1>
<% form_for(incident, :update=>'map_info'), :remote => true do |f| %>
 <p>
    <%= f.label :mountain %> <%= f.text_field :mountain %>
 </p>
 <%= f.hidden_field :latitude %>
 <%= f.hidden_field :longitude %>
 <p>
   <%= f.label :when %> <%= f.datetime_select :when %>
 </p>
 <p>
   <%= f.label :title %> <%= f.text_field :title %>
 </p>
 <p>
   <%= f.label :description %><br/>
   <%= f.text_area :description, :rows=>3 %>
 </p>
 <p>
   <%= f.submit "Create" %>
 </p>
<% end %>

Here’s the stack trace (when I load the page, then click on the map for a new incident):

Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-09-27 14:35:18
 +0100
Served asset /application.js - 304 Not Modified (173ms)
[2012-09-27 14:35:18] WARN  Could not determine content-length of response body.
 Set content-length of the response or set Response#chunked = true


Started GET "/assets/prototype.js?body=1" for 127.0.0.1 at 2012-09-27 14:35:18 +
0100
Served asset /prototype.js - 304 Not Modified (0ms)
[2012-09-27 14:35:18] WARN  Could not determine content-length of response body.
 Set content-length of the response or set Response#chunked = true


Started GET "/incidents.xml" for 127.0.0.1 at 2012-09-27 14:35:19 +0100
Processing by IncidentsController#index as XML
  ←[1m←[35mIncident Load (1.0ms)←[0m  SELECT "incidents".* FROM "incidents"
  Rendered text template (0.0ms)
Completed 200 OK in 945ms (Views: 184.0ms | ActiveRecord: 1.0ms)
[2012-09-27 14:35:20] WARN  Could not determine content-length of response body.
 Set content-length of the response or set Response#chunked = true


Started GET "/incidents/new?latitude=42.50990089326676&longitude=-99.4921875" fo
r 127.0.0.1 at 2012-09-27 14:35:43 +0100
Processing by IncidentsController#new as JS
  Parameters: {"latitude"=>"42.50990089326676", "longitude"=>"-99.4921875"}
ERROR: compiling _app_views_incidents__new_html_erb___613446974_25808988 RAISED
c:/Ruby193/incidents/app/views/incidents/_new.html.erb:2: syntax error, unexpect
ed ',', expecting keyword_end
'); form_for(incident, :update=>'map_info'), :remote => true do |f|
                                            ^
c:/Ruby193/incidents/app/views/incidents/_new.html.erb:23: syntax error, unexpec
ted keyword_ensure, expecting $end
Function body:           def _app_views_incidents__new_html_erb___613446974_2580
8988(local_assigns, output_buffer)
            _old_virtual_path, @virtual_path = @virtual_path, "incidents/_new";_
old_output_buffer = @output_buffer;incident = local_assigns[:incident];new = loc
al_assigns[:new];;@output_buffer = output_buffer || ActionView::OutputBuffer.new
;@output_buffer.safe_concat('<h1>New incident</h1>
'); form_for(incident, :update=>'map_info'), :remote => true do |f|
@output_buffer.safe_concat(' <p>
    ');@output_buffer.append= ( f.label :mountain );@output_buffer.safe_concat('
 ');@output_buffer.append= ( f.text_field :mountain );@output_buffer.safe_concat
('
');@output_buffer.safe_concat('  </p>
  ');@output_buffer.append= ( f.hidden_field :latitude );@output_buffer.safe_con
cat('
');@output_buffer.safe_concat('  ');@output_buffer.append= ( f.hidden_field :lon
gitude );@output_buffer.safe_concat('
');@output_buffer.safe_concat('  <p>
    ');@output_buffer.append= ( f.label :when );@output_buffer.safe_concat(' ');
@output_buffer.append= ( f.datetime_select :when );@output_buffer.safe_concat('
');@output_buffer.safe_concat('  </p>
  <p>
    ');@output_buffer.append= ( f.label :title );@output_buffer.safe_concat(' ')
;@output_buffer.append= ( f.text_field :title );@output_buffer.safe_concat('
');@output_buffer.safe_concat('  </p>
  <p>
    ');@output_buffer.append= ( f.label :description );@output_buffer.safe_conca
t('<br/>
    ');@output_buffer.append= ( f.text_area :description, :rows=>3 );@output_buf
fer.safe_concat('
');@output_buffer.safe_concat('  </p>
  <p>
    ');@output_buffer.append= ( f.submit "Create" );@output_buffer.safe_concat('

');@output_buffer.safe_concat('  </p>
'); end
@output_buffer.to_s
          ensure
            @virtual_path, @output_buffer = _old_virtual_path, _old_output_buffe
r
          end

Backtrace: C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_v
iew/template.rb:297:in `module_eval'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/templat
e.rb:297:in `compile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/templat
e.rb:244:in `block in compile!'
<internal:prelude>:10:in `synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/templat
e.rb:232:in `compile!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/templat
e.rb:144:in `block in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications.rb:125:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/templat
e.rb:143:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/partial_renderer.rb:265:in `render_partial'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/partial_renderer.rb:238:in `block in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/abstract_renderer.rb:38:in `block in instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications.rb:123:in `block in instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications/instrumenter.rb:20:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications.rb:123:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/abstract_renderer.rb:38:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/partial_renderer.rb:237:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/renderer.rb:41:in `render_partial'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_view/rendere
r/renderer.rb:15:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/rendering.rb:110:in `_render_template'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/streaming.rb:225:in `_render_template'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/rendering.rb:103:in `render_to_body'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/renderers.rb:28:in `render_to_body'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/compatibility.rb:50:in `render_to_body'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/rendering.rb:88:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/rendering.rb:16:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:40:in `block (2 levels) in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
ore_ext/benchmark.rb:5:in `block in ms'
C:/Ruby193/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
ore_ext/benchmark.rb:5:in `ms'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:40:in `block in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:83:in `cleanup_view_runtime'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.4.rc1/lib/active_record/rai
lties/controller_runtime.rb:24:in `cleanup_view_runtime'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:39:in `render'
c:/Ruby193/incidents/app/controllers/incidents_controller.rb:24:in `block (2 lev
els) in new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/mime_responds.rb:196:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/mime_responds.rb:196:in `respond_to'
c:/Ruby193/incidents/app/controllers/incidents_controller.rb:20:in `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/implicit_render.rb:4:in `send_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/base.rb:167:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/rendering.rb:10:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/callbacks.rb:18:in `block in process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:414:in `_run__322942522__process_action__447782570__callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:405:in `__run_callback'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:385:in `_run_process_action_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:81:in `run_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/callbacks.rb:17:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/rescue.rb:29:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:30:in `block in process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications.rb:123:in `block in instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications/instrumenter.rb:20:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/n
otifications.rb:123:in `instrument'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/instrumentation.rb:29:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/params_wrapper.rb:206:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.4.rc1/lib/active_record/rai
lties/controller_runtime.rb:18:in `process_action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/base.rb:121:in `process'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/abstract_controller
/rendering.rb:45:in `process'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal.rb:203:in `dispatch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal/rack_delegation.rb:14:in `dispatch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_controller/m
etal.rb:246:in `block in action'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/rou
ting/route_set.rb:73:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/rou
ting/route_set.rb:73:in `dispatch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/rou
ting/route_set.rb:36:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `b
lock in call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `e
ach'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `c
all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/rou
ting/route_set.rb:600:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/best_standards_support.rb:17:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in
`call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/head.rb:14:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/params_parser.rb:21:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/flash.rb:238:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:2
05:in `context'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:2
00:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/cookies.rb:338:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.4.rc1/lib/active_record/que
ry_cache.rb:64:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.4.rc1/lib/active_record/con
nection_adapters/abstract/connection_pool.rb:473:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/callbacks.rb:28:in `block in call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:405:in `_run__711941801__call__927210605__callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:405:in `__run_callback'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:385:in `_run_call_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
allbacks.rb:81:in `run_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/callbacks.rb:27:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/reloader.rb:65:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/remote_ip.rb:31:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/debug_exceptions.rb:16:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/show_exceptions.rb:56:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.4.rc1/lib/rails/rack/logger.rb:
26:in `call_app'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.4.rc1/lib/rails/rack/logger.rb:
16:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/request_id.rb:22:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in
`call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.4.rc1/lib/active_support/c
ache/strategy/local_cache.rb:72:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_dispatch/mid
dleware/static.rb:62:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.4.rc1/lib/rails/engine.rb:479:i
n `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.4.rc1/lib/rails/application.rb:
220:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in
`call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.4.rc1/lib/rails/rack/log_tailer
.rb:17:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in
 `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
  Rendered incidents/_new.html.erb (169.0ms)
Completed 500 Internal Server Error in 178ms

ActionView::Template::Error (c:/Ruby193/incidents/app/views/incidents/_new.html.
erb:2: syntax error, unexpected ',', expecting keyword_end
'); form_for(incident, :update=>'map_info'), :remote => true do |f|
                                            ^
c:/Ruby193/incidents/app/views/incidents/_new.html.erb:23: syntax error, unexpec
ted keyword_ensure, expecting $end):
    1: <h1>New incident</h1>
    2: <% form_for(incident, :update=>'map_info'), :remote => true do |f| %>
    3:  <p>
    4:     <%= f.label :mountain %> <%= f.text_field :mountain %>
    5:   </p>
  app/controllers/incidents_controller.rb:24:in `block (2 levels) in new'
  app/controllers/incidents_controller.rb:20:in `new'


  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_d
ispatch/middleware/templates/rescues/_trace.erb (5.0ms)
  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_d
ispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms)
  Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.4.rc1/lib/action_d
ispatch/middleware/templates/rescues/template_error.erb within rescues/layout (1
38.0ms)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:49:05+00:00Added an answer on June 12, 2026 at 5:49 am

    According to the error:

    Its the "," from in front of the :remote => true, behind the form_for(incident, :update=>'map_info'). Remove it

    Ok so lets recode it. Try:

    <%= form_for incidents_url, :remote => true do |f| %>
    

    You have to add a new file in incidents called new.js.erb (incidents/new.js.erb). Normally it would be called create.js.erb, but you’re using the new action, not create.

    Inside that file you write the jQuery code that updated the div.

    $(".class_name_of_div").prepend("<%= @incident.which_ever_attribute_you_want %>");
    

    Also you might want to change your controller a bit:

    def new
      @incident = Incident.new
      @incident.latitude = params[:latitude]
      @incident.longitude = params[:longitude]
      @incident.save
    
      respond_to do |format|
        format.html
        format.js
      end
    end
    

    Change the partial too:

    <%= render 'incidents/map', :incident => @incident %>
    

    Tell me how it goes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.