Hi everyone, Sorry for the long delay, crazy weeks after getting installed in our new place in Denmark. I've seen this debate this discussion a couple of times, and I think the main points have been:
- HTML says <a> tags are supposed to only trigger GET requests. - Avoiding <a> with POST requests prevents crawlers from clicking where they shouldn't. But this does not apply to non-public UIs applications requiring logging in). - Using <a> with POST/PUT can be very useful with Hobo: it's "faster/easier" than creating a form and I have personally missed it quite a few times. I vote for removing the limitation and allowing developers to use <a> if they want to. I have opened a Github issue about this. Unless someone strongly disagrees, we'll try to make this happen :). https://github.com/Hobo/hobo/issues/127 Warm regards, Ignacio El 02/10/14 a las #4, kevinpfromnm escribió: > If it is in there, should we really have the ability to vary the method > on an <a> tag? From what I recall from html specs, <a> is supposed to > be safe to follow and thus should not be altering anything as using an > HTTP put/post/delete implies. > > On Sunday, September 28, 2014 11:52:50 AM UTC-6, donz wrote: > > Hello again! > > I encountered this problem while trying to solve the issue with > rendering partials from within partials (which Ignacio solved > elegantly). > > At first I thought I just didn't understand what was happening, but > now that everything else is working, I had time to look at this and > there really is a disconnect between dryml and routes.rb. > > It doesn't seem to matter what *method* (e.g. *get*, *put*, > *post*,...) I put in the dryml *<a>* tag, the links are only active > if the associated entry in routes.rb is set to *get* as in: > > <a action=up" method="post" update="agenda-items"/> > <a action=up" method="put" update="agenda-items"/> > <a action=up" method="get" update="agenda-items"/> > > all work with > > resources :agenda_items do > > member do > > get 'up' # this works > > get 'down' # this works > > end > > end > > none work with > > resources :agenda_items do > > member do > > put 'up' # this doesn't work > > put 'down' # this doesn't work > > end > > end > > or > > resources :agenda_items do > > member do > > post 'up' # this doesn't work > > post 'down' # this doesn't work > > end > > end > > > When I say it doesn't work, the link is not even activated. The > generated HTML has no <a> tag, only the associated text/image. I > looked at the source for the dryml <a> and it has a specific case > for *method != 'get*', but that only seems to invoke some jquery > stuff that is not related to the route (I may be wrong in this > assumption). The log shows a series of errors when routes.rb does > not use *get*. Typical of these is: > > recognize_path has failed: No route matches > "/agenda_items/1-approval-of-last-month-s-minutes/down" > > > These errors occur once per link whenever the page is refreshed. > (The error message would be much more informative if it showed the > failing method too). > > Since the links/buttons actually modify the data (in this case by > re-ordering the table), I would rather use *put* or *post* so that > the data are not changed if someone spiders the site. > > Any suggestions/ideas? > > Thanks, > > Don Ziesig > > > -- > 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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/hobousers. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.
