First and foremost:
I am not a very experienced web-developer or developer for that matter. I've only spent about a year with Rails, however there is something I have noticed about my projects and would like to get off my chest. Please chime in and share your thoughts. The Model-part of things is clearly structured and well tested and as a result of that I have a lot of confidence in that code. In my opinion this is one positive effect of “Convention over Configuration”, even as a newcomer it didn’t take a lot of time till I learned via IRC or a Screen/Podcast: “Hey! This code belongs in the model”. Also there are a lot of discussions going on in the community (Jim Weirich, Avdi Grimm, James Edward Grey II and the rest of the Rogues, Gary Bernhardt and many more) about how to organize models/objects in Rails, which I find very helpful. As I move towards the view though, the messier my code becomes. It starts with the controller and a lot of instance variables as I tend to move away from RESTful-Rails. To be more specific: I merge the edit, show and new actions into one. Controllers are still tested though and therefore I am confident that they too, behave as expected. But the intersection between jQuery and CSS tends to be a real problem. One reason is that DOM elements (classes and ids) get mixed with jQuery's Selectors and I haven’t found a way to decouple this behavior from the classes and ids. Another is I have no real clue where to put my JS, honestly. Currently it’s all in the application.js. Here my code also tends to be untested and as a result I have no confidence in the UI-Code, as soon as a class or id is renamed I have to manually test the whole page. (I understand that there are a lot of JS frameworks trying to solve these problems, but my apps don't have a ton of JS (800-1000 LOC) and the introduction of a client-side framework might be overkill. I am also under the impression that these frameworks are still under heavy development and the community has not decided which one to use yet.) Now, these “problems” starting with the controller and ending with the view are a result of a motion towards “one-page” applications and away from the (in my understanding) Restful-Rails-apps. But it is obviously the way that a lot of us want to experience and build the web. I guess it boils down to this: I have no idea how to write clear, confident front-end code for my rails app. Could you help me? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/XZ338gPM3q8J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

