ruby on rails - How to show uploaded photos in the view -


I am using the carrier's gem and I am trying to upload it to the controller so that all photos are uploaded. (In the photo table inside) by using the box version in the scene. I think that only the selected users are able to show the photo, but I want to show all the uploads.

Photo Controller:

  DEF New @ photo = Photo. Make a new end def @ photo = photo.create (param [: photos]) @photo.user = current_user if @photo. Save flash [: notice] = "photos successfully created." Redirect_to: Backere render: Action => Manipulate the 'new' end-end def size (width, height, gravity = 'center')! Do Img | Do img.combine_options | Cmd | Cmd.resize "# {width}" if img [: width]  'Edit' end-end DF deleted @ photo = photo. Afid (Param [: id]) @photo diestore flash [: notice] = "The photo was successfully destroyed." Redirect_to: back end def Avatar if current_user.update_attribute (: avatar_id, params [: id]) Flash [: notice] = "Successfully created avatar." Else flash [: notice] = "avatar failed" at end redirect_to: back, note: "set as avatar!" Finally, if I understood my question correctly, then I think that you An index method requires your controller  
  DIF index @ photo = photo.You  

and if you want to show all the photos in your view Will have to loop

  - @ photos.each do | Photos | = Image_tag photo.content_url  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -