Marcelo de Moraes Serpa
2011-Oct-09 04:57 UTC
Client-side work, removing Rails out of the equation
I was wondering how what you do when you have some serious client-side work to do on a Rails app. Good practice tells us to start from testing, so let''s say we either: 1) Have Implement a bare-bones html (non-ajax) version of the feature using an outside-in testing process already. 2) We don''t (argh) have or follow a test-driven process. Anyway, the point is, once you have the basic done, you then want to focus on the GUI. The client wants it to look and behave in a specific way, and you go and start putting your awesome client-side skills into action. Form my experience, if the application is still small, it''s a no brainer to just go and modify the ERB/HAML/CSS/SASS as needed. However, when the app gets stuffed with more objects, doing client-side work is just too painful (requests can take several seconds). What I like to do when a lot of client-side work is expected is to create a separate folder with styles and the view(s) needed copied (erb removed, of course), use placeholder data where needed (I might also test-drive the javascript), and focus on the client-side only. You then remove Rails out of the equation, which makes the process smoother. How do you do it? Cheers, - Marcelo. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
aamax-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org
2011-Oct-09 05:32 UTC
testing: setting checkbox value
I have been working through Hartl''s tutorials and am in chapter 11... almost done with it but have found a couple problems and am at a loss for solving them. First, prior to trying to add the ability to edit admin status all my tests were passing and if i take that one test out they pass again... 1. I noticed today that when i do a user delete, it redirects to the deleted users profile page like it''s supposed to but the user is never deleted from the database. no errors are displayed.. 2. When i try to delete a micropost i get a message saying "No route matches [GET] "/microposts/302"" I found a reference on stackoverflow for someone who had the same problem and solved it but I didn''t get any relief from it on my side. 3. I wanted to add the ability to set and unset the admin field in the database for a user so i added a checkbox to the user edit page. The checkbox shows up and has the correct value (which i thought was a pretty good achievement :)) and i wanted to write a test to ensure that my update works but i don''t know how to set the checkbox programatically in the test. I''m putting it in the users_spec.rb and realize that i''m not doing it as elegantly as i should but I''m not so worried about that as i am the mechanics of what is happening as i''m trying to learn here. I''ve pushed my code up to github and tagged the commit with "admin-problem" in case anyone wants to check it out.... it''s at: git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:aamax/sample_app.git I''d love some help with this... am feeling like i''ve been picking up ruby and rails pretty well, long way to go, but i''ve hit these couple walls and spent a ton of time on it. thanks in advance. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
i apologize, didn''t mean to write this as a reply. meant it as a new subject.. will repost... doh! On Oct 8, 11:32 pm, aa...-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org wrote:> I have been working through Hartl''s tutorials and am in chapter 11... > almost done with it but have found a couple problems and am at a loss > for solving them. > > First, prior to trying to add the ability to edit admin status all my > tests were passing and if i take that one test out they pass again... > > 1. I noticed today that when i do a user delete, it redirects to the > deleted users profile page like it''s supposed to but the user is never > deleted from the database. no errors are displayed.. > > 2. When i try to delete a micropost i get a message saying "No route > matches [GET] "/microposts/302"" I found a reference on stackoverflow > for someone who had the same problem and solved it but I didn''t get > any relief from it on my side. > > 3. I wanted to add the ability to set and unset the admin field in the > database for a user so i added a checkbox to the user edit page. The > checkbox shows up and has the correct value (which i thought was a > pretty good achievement :)) and i wanted to write a test to ensure > that my update works but i don''t know how to set the checkbox > programatically in the test. I''m putting it in the users_spec.rb and > realize that i''m not doing it as elegantly as i should but I''m not so > worried about that as i am the mechanics of what is happening as i''m > trying to learn here. I''ve pushed my code up to github and tagged the > commit with "admin-problem" in case anyone wants to check it out.... > it''s at: g...-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:aamax/sample_app.git > > I''d love some help with this... am feeling like i''ve been picking up > ruby and rails pretty well, long way to go, but i''ve hit these couple > walls and spent a ton of time on it. thanks in advance.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.