public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Polished up handling of nil photo param (the iPhone bug)
Michael Hartl (author)
Fri May 16 12:30:40 -0700 2008
commit  e1fd8b8e440c9f3ab34161d4e87de78e956c1012
tree    bfe11afff13499c63ff4e63347234d93fa20d275
parent  e58dfbc1ddbfd2327ee4031c4b8a0f29061e4107
...
27
28
29
30
31
32
33
34
 
 
 
 
 
35
36
37
...
27
28
29
 
 
 
 
 
30
31
32
33
34
35
36
37
0
@@ -27,11 +27,11 @@
0
   end
0
 
0
   def create
0
- if params[:commit] == "Cancel" or params[:photo].nil?
0
- flash[:error] = 'It\'s look like your browser ' +
0
- 'doesn\'t support file uploading' if params[:commit] != "Cancel"
0
- redirect_to edit_person_url(current_person)
0
- return
0
+ if params[:photo].nil?
0
+ unless params[:commit] == "Cancel"
0
+ flash[:error] = "Your browser doesn't appear to support file uploading"
0
+ end
0
+ redirect_to edit_person_url(current_person) and return
0
     end
0
     person_data = { :person => current_person,
0
                     :primary => current_person.photos.empty? }
...
62
63
64
65
 
66
67
68
...
62
63
64
 
65
66
67
68
0
@@ -62,7 +62,7 @@
0
       flash[:error].should be_nil
0
     end
0
     
0
- it "should handle nil photo parametr" do
0
+ it "should handle nil photo parameter" do
0
       post :create, :photo => nil
0
       response.should redirect_to(edit_person_url(@person))
0
       flash[:error].should_not be_nil

Comments

    No one has commented yet.