Ruby on Rails Wednesday, January 5, 2011

On 5 January 2011 11:04, Daniel Oton <lists@ruby-forum.com> wrote:
> Thanks for your response.
>
> If I use <%= form_for... It breaks
> ActionView::TemplateError (compile error
> /home/fydserve/intraweb/app/views/items/new.html.erb:5: syntax error,
> unexpected ')'
> ...(( form_for(@item) do |f| ).to_s); @output_buffer.concat ...
>                              ^
> /home/fydserve/intraweb/app/views/items/new.html.erb:28: syntax error,
> unexpected kENSURE, expecting ')'
> /home/fydserve/intraweb/app/views/items/new.html.erb:30: syntax error,
> unexpected kEND, expecting ')') on line #5 of
> app/views/items/new.html.erb:
>
> View Code:
>
> <%= form_for(@noticia) do |f| %>

I don't understand, the error above shows form_for(@item) so this
would not appear to be the code generating the error.

>  <%= f.error_messages %>
>  <p><%= f.label :title %><br /><%= f.text_field :title %></p>
>  <p><%= f.label :description %><br /><%= f.rich_text_area :description
> %></p>
>  <p><%= f.submit 'Create' %></p>
> <% end %>
>
> HTML generated: It generates the script and atributte
> class="simple_nicedit" in textarea, but the view is showing normal
> textarea.

How is it generating html if you get a compile error?

Colin

>
> <script src="/javascripts/nicEdit.js?1294182055"
> type="text/javascript"></script>
> <script src="/javascripts/nicEditInit.js?1294182055"
> type="text/javascript"></script>
>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> ...
> </head>
> <body>
>
> <form action="/items" class="new_item" id="new_item" method="post"><div
> style="margin:0;padding:0;display:inline"><input
> name="authenticity_token" type="hidden"
> value="FCnWc8Q8vcadwBSnlhENQpmDjAECikKAK9ecOtFzjoI=" /></div>
>  <p>
>    <label for="item_title">Title</label><br />
>    <input id="item_title" name="item[title]" size="30" type="text" />
>  </p>
>  <p>
>    <label for="item_description">Description</label><br />
>    <textarea class=" simple_nicedit" cols="40" id="item_description"
> name="item[description]" rows="20"></textarea>
>  </p>
>  <p>
>    <input id="item_submit" name="commit" type="submit" value="Create"
> />
>  </p>
> </form>
> </body>
> </html>
>
> thanks
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment