Hi Bryan,

the error occurs while rendering of the page. So long before the action is 
triggered.

what does a dryml file need to accept a "part" attribute on a div tag?

Alex.


On Monday, February 4, 2013 12:03:51 AM UTC+1, Bryan Larsen wrote:
>
> Your controller action needs part support.   It's baked into the 
> standard Hobo actions, but if you're using a Rails action, you need to 
> add it yourself. 
>
> def my_action 
>   if request.xhr? && params[:render] 
>     hobo_ajax_response 
>   else 
>     render whatever 
>   end 
> end 
>
> Bryan 
>
>
> On Sun, Feb 3, 2013 at 5:55 PM, Alex Greif 
> <[email protected]<javascript:>> 
> wrote: 
> > Hi Bryan, 
> > 
> > All what I want to do is to have a button, that makes a simple ajax call 
> > and replaces the content of a div wi a simple text, nothing more. 
> > I think I completely misunderstand something with this parts concept, 
> but 
> > I cannot figure it out. 
> > 
> > 
> > I have a very simple hobo model with the generated controller. 
> > I added only one method to the controller: 
> > 
> >   def do_something 
> >     render :text => "test" 
> >   end 
> > 
> > here is an excerpt of my (not working) show.dryml with this error: 
> > error: 
> > invalid part="my_id" attribute on <div> 
> > 
> > <show-page> 
> >   <append-content-body:> 
> >      <div part="my_id">N/A</div> 
> >      <form with="&this" action="do_something" update="my_id"><submit 
> > label="Do Something"/></form> 
> >   </append-content-body:> 
> > </show-page> 
> > 
> > 
> > I had to remove the part concept totally, because it did not work. 
> > Even <part name="...."> throw an exception, that part is not a method 
> > 
> > here is my new version: 
> > 
> > <show-page> 
> >   <append-content-body:> 
> >      <div part="my_id">N/A</div> 
> >     <form action="&do_something_path(this)" updates="#my_id"><submit 
> > label="Do Something"/></form> 
> >     Name: <div id="myname">N/A</div> 
> >   </append-content-body:> 
> > </show-page> 
> > 
> > this uses routes: 
> >   match 'mymodel/:id/do_something' => 'mymodel#do_something', :as => 
> > 'do_something' 
> > 
> > and the controller does: 
> > 
> >   def do_something 
> >     render :text => "$('#my_id').html('...')" 
> >   end 
> > 
> > 
> > Alex. 
> > 
> > 
> > 
> >> Hi Alex, 
> >> 
> >> That sort of structure is used very commonly in Hobo apps.   Just to 
> >> test, I modified one of my apps to use a structure closer to what you 
> >> described, and it works fine.   I'm going to need more information to 
> >> help you track your problem down. 
> >> 
> >> Bryan 
> >> 
> >> 
> >> On Sun, Feb 3, 2013 at 10:43 AM, Alex Greif 
> >> <[email protected]<javascript:>> 
> wrote: 
> >>> Hi, 
> >>> 
> >>> i have got a problem with a simple ajax update. 
> >>> 
> >>> my view: 
> >>>     <div part="my_id">N/A</div> 
> >>>     <form with="&this" action="do_something" update="my_id"><submit 
> >>> label="Do Something"/></form> 
> >>> 
> >>> error: 
> >>> invalid part="my_id" attribute on <div> 
> >>> 
> >>> does anybody have an idea whats wrong? I use 2.0.0pre8 
> >>> 
> >>> thanks 
> >>> alex. 
> >>> 
> >>> -- 
> >>> You received this message because you are subscribed to the Google 
> >>> Groups 
> >>> "Hobo Users" group. 
> >>> To unsubscribe from this group and stop receiving emails from it, send 
> >>> an 
> >>> email to [email protected] <javascript:>. 
> >>> To post to this group, send email to 
> >>> [email protected]<javascript:>. 
>
> >>> Visit this group at http://groups.google.com/group/hobousers?hl=en. 
> >>> For more options, visit https://groups.google.com/groups/opt_out. 
> >>> 
> >>> 
> >> 
> >> -- 
> >> You received this message because you are subscribed to the Google 
> Groups 
> >> "Hobo Users" group. 
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an 
> >> email to [email protected] <javascript:>. 
> >> To post to this group, send email to 
> >> [email protected]<javascript:>. 
>
> >> Visit this group at http://groups.google.com/group/hobousers?hl=en. 
> >> For more options, visit https://groups.google.com/groups/opt_out. 
> >> 
> >> 
> >> 
> >> 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Hobo Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected]<javascript:>. 
>
> > Visit this group at http://groups.google.com/group/hobousers?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to