Achithyn wrote:
I was wondering, is Ruby on Rails dependent on JavaScript?
No. You can write all kinds of websites without any JS. The only drawback is slight user hostility in various corners of the application. For example, you should pre-select your first edit field, like www.google.com's home page does. Without JavaScript you can't do that.
And you must avoid RoR constructions that spontaneously generate JS...
A little background to this question: I created a link that would
remove an element from the database. Thus, this link has a :method
=> :delete appended to the end.
Doesn't that create a call to an HTTP DELETE verb? That can't be what you want, because I suspect the basic intent is "delete this web page off your server".
> When I look at the source this code
generates, there is a huge ugly paragraph of JavaScript.
Is that code what's required to convert a normal link into a DELETE link?
> I loaded up
FireFox and disabled JavaScript and was unable to remove the element.
I was simply redirected to the show action.
Don't use :method => :delete. A link that deletes should use :method => :post. If you switch to that, do you get more JS?
If my members have JavaScript disabled, are there some elements of
Ruby on Rails that will simply not work? Thanks for your help!
An action that deletes should not call with the GET verb.
In terms of user hostility, if a simple _link_ cannot call POST without a blob of JavaScript, then you will have to use the non-JS version, which is a complete <form> and a submit button. This looks ugly, but it's still tractable. Look at GMail in HTML-only mode, for example.