I'm trying to use the rails-ckeditor gem with Hobo, and running into some
problems. To test the problems, I made a vanilla Rails 3 app, and added a
ck_textarea field, and it all works fine including uploading files, etc. I
tried the same thing with a simple Hobo app, and did not have the same luck.
I'm trying to figure out how a basic Hobo model-view-controller differs from
the rails one generated by "rails generate scaffold"...
In my Hobo app, I first tried adding to my application.dryml
<def attrs='name' tag='input' for='html'>
<%= ckeditor_textarea(this,name, :width => '100%', :height => '200px') %>
</def>
which did not work, and gave the error:
undefined method `entry[body]' for nil:NilClass
But the rails generator used a different helper, so I then deleted that and
tried re-creating the whole form:
<def tag="form" for="Entry">
<%= form_for(@entry) do |f| %>
<% if @entry.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@entry.errors.count, "error") %> prohibited
this entry from being saved:</h2>
<ul>
<% @entry.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :body %><br />
<%= f.cktext_area :body %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
</def>
Note that the whole thing other than <def> and </def> is the _form.html.erb
that worked fine in the Rails app. Now I get
app/views/taglibs/application.dryml:12: syntax error, unexpected ')'
...at(( form_for(@entry) do |f| ).to_s); output_buffer.concat "...
How might I proceed? I tried also Matt's suggestion of
<def tag="input" for="raw_html" attrs="name">
<%= ckeditor_textarea(*path_for_form_field) %>
</def>
but this did not work either, giving:
undefined method `body' for nil:NilClass
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.