ruby on rails - Uploading image with paperclip to S3 Bucket gives error: undefined method 'match' -


i'm trying setup application uses paperclip imageuploader upload files s3 bucket. config looks this:

config.paperclip_defaults = {  :storage => :s3,  :s3_permissions => 'public-read',  :s3_credentials => {   :bucket => env['aws_bucket_id'],   :access_key_id => env['aws_access_key_id'],   :secret_access_key => env['aws_secret_access_key'],   :region => env['aws_region']  } } 

creating post image working fine, giving me error:

nomethoderror (undefined method `match' nil:nilclass): app/controllers/posts_controller.rb:33:in `create' 

my post model:

has_attached_file :image, styles: { :medium => "640x" } 

validates_attachment_content_type :image, :content_type => /\aimage\/.*\z/

my post controller:

def create  @post = current_user.posts.build(post_params)  if @post.save(post_params)   flash[:success] = "your post has been created!"   redirect_to posts_path  else   flash.now[:alert] = "your new post couldn't created! please check form."   render :new  end end 

i don't know going wrong. question pretty same asked here, answers did not solved me:

stack post

if me bit appreciated!


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -