I am running Ruby on Rails 3 and I have almost completed my application. All controllers, views and models are implemented for my needs (login function, logout function, new user creation function, mailer, ...). I also created a layout (mostly using sub-layouts and'content_for') and implemented some AJAX functions.
So, what should I do now (except the deployment) in order to improve \ complete my application?
One my doubt, for example, is whether to use view files as they are or create a dedicated controller only to handle pages. That is, is it good to create a "User page" that renders 'views/user/show.html.erb' and 'views/user/edit.html.erb' templates in one page instead of using views files separately calling those using link开发者_JAVA百科_to
?
Of course there are other doubts that, maybe, I don't know yet. I would appreciate if you could share your and make suggestions.
Is this something that you're going to keep and maintain for a while? If so my advice would be to test it. Look into Test::Unit or RSpec (which I prefer) and test your models and controllers. You'll no doubt want to go back and refactor, and it'll be a lot easier if you have a healthy set of tests validating that everything still works as expected.
精彩评论