ruby on rails - No route matches /signout when i disable javascript -
to signing out user have link :
link_to "sign out", signout_path, method: "delete"
this link work fine , have route /signout in routes file, when disable javascript , click link says : no route matches [get] "/signout", what's problem here ?
without scripting, browsers can send non-get request submitting form -- clicking link get. when specify different method link_to
, adds javascript hook link dynamically creates , submits form appropriate method. if scripting disabled, browser submits request would. this explained in docs here (look under options).
if app needs support users scripting disabled, can use button_to
instead of link_to
, , style button link.
Comments
Post a Comment