search for: comment_1

Displaying 2 results from an estimated 2 matches for "comment_1".

Did you mean: comment1
2008 Mar 17
4
RSpec''ing model association callbacks
...mments = Comment.find_all_by_user_id(self.id) comments.each { |c| c.destroy } end end ----------------- User Spec describe User, " being deleted" do before(:each) do end it "should see deleted his own comments" do user = Factory.create_user() comment_1 = Factory.create_comment(:author => user) comment_2 = Factory.create_comment(:author => user) user.destroy comment_1.should be nil comment_2.should be nil end end ----------------- Factory Module def self.create_user(attributes = {}) default_attributes = { :...
2008 Jul 17
2
Final Opinion :: Need final opinions on the best way to handle arrays in forms
...ment" /> <input type="text" name="comment[2][title]" value="My Comment" /> I was able to do this in rails as well using: text_field "comment[][title]" ... Then I read somewhere else that people were doing something like this text_field "comment_1[title]" and then parsing out the data. Which one is better? I would tend to think that the array method above is superior, but then again, I may have no clue what I am talking about. Is there another method that I am not thinking of? Thanks!!!! --~--~---------~--~----~------------~-------...