im currently trying to implement a form with several buttons, and my
solution for that was to make a full form for each of the 5 buttons.
thats extremely repetitive, so i wanted to generate the forms with a
helper function that i define myself, but i cant make it work.

my form method:

module ApplicationHelper
   def raw_datum_new_helper(status)

     form_for(@raw_datum) do |f|
       if @raw_datum.errors.any?
       "<div id='error_explanation'>"
         "<h2>#{pluralize(@raw_datum.errors.count, "error"})prohibited
this raw_datum from being saved:</h2>"
         @raw_datum.errors.full_messages.each do |msg|
     <% end %>

     "<div class='field'>"
     #{f.hidden_field :timestamp, :value =>[0,16]
       f.hidden_field :status, :value => status}
     </div><div class='actions'>"
       f.submit :value => status


my errors when calling <%= raw_datum_new_helper("ins Bett gelegt") %>:
syntax error, unexpected '}', expecting ')'
...aw_datum.errors.count, "error"})prohibited this raw_datum fr...
... ^
syntax error, unexpected ':', expecting '}'
...his raw_datum from being saved:</h2>"
... ^
unknown regexp option - l
syntax error, unexpected '<'
unknown regexp options - dv
syntax error, unexpected keyword_class, expecting keyword_do or '{' or
     "<div class='field'>"
syntax error, unexpected keyword_end, expecting '}'

Does anyone have an idea as to how to go about this?

Posted via

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
grouprubyonrails-talk @
postedJun 11, '16 at 4:51p
activeJun 11, '16 at 6:11p

2 users in discussion

Rynn Steinbolt: 2 posts Nanaya: 1 post



site design / logo © 2021 Grokbase