Open quux00 opened 13 years ago
After researching, the problem is that if there is no JavaScript, then a link (in this case an image based link) will just do what the link says, which is to go to the line_items page. It's the controller that overrides that but to get it to the controller, the JavaScript has to intercept it and change the default behavior of the link. My conclusion is that you can't use straight links (or image links) if you want this to work without JavaScript. You need to use form elements and I don't know how to make an image a form element. Maybe I'll figure that out someday.
When JavaScript is disabled and you are on the store_url (root) main page, clicking the book image does a
GET /line_items
, rather than aPOST /line_items
. Thus, it goes to theLineItem#index
action rather than to theLineItem#create
action. I don't know any way to change this behavior, so suggested fix is to makeLineItem#index
return directly to the store front with no action taken and put a flash :notice that JS must be enabled to use the image buttons.Other ideas?