I'm comparing some Rails link_to
tags.
In one place (where an admin can delete a user account), a template has:
link_to "Delete", user, method: :delete
In another place (where someone can log out, deleting a session), a different template has:
link_to "Log out", logout_path, method: "delete"
I've tried both :delete
and "delete"
in both places, and the code seems to work the same in all configurations. So...is the syntax interchangeable? If so, is one preferable? I notice that in the docs, the symbol form is discussed and shown, but the quotation mark form is used once as well.
Note, this isn't just a question whether to use symbol or string arguments or keys, I think. I understand that. It's about the particular inconsistent usage spotted with regard to this particular method.
Sorry if this is a noob question.