So, I'm really curious now though about what's up with the editor tag
provided by hobo.  There are some messages from late july talking
about it, and it sounds like something was fixed then, but I suppose
it was then broken again.

Removing behaviour_class from hobo/lib/hobo/rapid_helper.rb seems to
make the undefined method error go away, but then you just get text
without an editor box :-/  Adding a 'def behaviour_class "in-place-
textfield-bhv" end' entry to the ApplicationHelper module (just to see
what happens) gives an even more confusing result.

Anyway, thanks again for the workaround!

--Jorge

On Sep 3, 5:00 pm, programmerjorge <[EMAIL PROTECTED]> wrote:
> Wow, yeah, this should work great!
>
> Thanks a bunch!
>
> --Jorge
>
> On Wed, Sep 3, 2008 at 12:46 PM, blizz <[EMAIL PROTECTED]> wrote:
>
> > Here is something you can do while waiting for the rest of the in-
> > place editors to come online, of course you could do it with non-ajax
> > field editors as well.
>
> > In application.dryml put:
>
> > <def tag="myeditor" ><%=
> >  if !can_edit?
> >    view(attributes)
> >  else
> >    attrs = add_classes(attributes, type_id, type_and_field, "editor")
> >    if (refl = this_field_reflection)
> >      if refl.macro == :belongs_to
> >        belongs_to_editor(attrs)
> >      else
> >        has_many_editor(attrs)
> >      end
> >    else
> >      call_polymorphic_tag("myeditor", attrs) or
> >        raise HoboError.new("<myeditor> not implemented for
> > #{this.class.name}\##{this_field} " +
> >                            "(#{this.inspect}:#{this_type})")
> >    end
> >  end
> > %></def>
>
> > <def tag="myeditor" for="string">
> >  <my-string-editor merge-attrs/>
> > </def>
>
> > <def tag="my-string-editor" attrs="update, values, labels, titleize"><
> > %
> >  f = ajax_updater(object_url(this_parent, :method => :put),
> >                   update,
> >                   :method => "put",
> >                   :params => { this_parent.class.name.underscore => {
> >                       this_field => Hobo.raw_js('this.value')
> >                    } })
> > %>
> >  <input type="text" onchange="#{f}" value="#{this}"
> >         merge-attrs />
> > </def>
>
> > The in the show.dryml you can call:
>
> > <myeditor:amount/>  (where amount is the string field added to the
> > ingredient_assignments table)
>
> > The context has to be ingredient_assignments, here is how it would
> > look in the agility demo (show.dryml for project)
>
> > <show-page>
>
> >  <content:>
> >    <section-group>
> >      <section>
> >        <param-content for="content"/>
> >      </section>
> >      <aside>
> >        <h2>Project Members</h2>
> >        <collection:memberships part="members">
> >          <card>
> >                <heading:>
> >                   <a:user/><editor:contributor/
> > >Contributor:<myeditor:amount/>
> >                         </heading:>
> >          </card>
> >        </collection>
> >        <form:memberships.new update="members" reset-form refocus-
> > form>
> >          <div>
> >            Add a member:
> >            <name-one:user complete-target="&@project"
> > completer="new_member_name"/>
> >          </div>
> >        </form>
> >      </aside>
> >    </section-group>
> >  </content:>
>
> >  <collection: replace>
> >    <table-plus with="&@stories" fields="this, tasks.count, status">
> >          <prepend-header:>
> >            <div class="filter">
> >              Display by status: <filter-menu param-name="status"
> > options="&StoryStatus.all"/>
> >            </div>
> >          </prepend-header:>
> >      <empty-message:>No stories match your criteria</empty-message:>
> >    </table-plus>
> >  </collection:>
> > </show-page>
>
> > And just to be complete the model code for ProjectMembership...
>
> > ....
> >  fields do
> >    contributor :boolean
> >    amount :string
> >    timestamps
> >  end
> > ....
>
> > Hope this helps :)
>
> > Brett
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to