[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-22 Thread David Williams
I got it working, but now, I just have to add AJAX. <% if user_signed_in? %> <% if current_user.following?(@user) %> <%= link_to "Unfollow", unfollow_user_path(@user), class: 'btn btn-danger' %> <% else %> <%= link_to "Follow", follow_user_path(@u

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
This is a broader issue than just file uploads anyway so I need to learn this, if you read the link I posted they make carrierwave sound good so i wanna get comfortable with using it On Friday, January 22, 2016 at 9:20:04 PM UTC-5, Przemek Kosakowski wrote: > > Are you using Paperclip or other

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file_field :image %> > > > <%= f.submit %> > > <% end %> > >

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
I'm using carrierwave In my controller I can test for the presence of params[profile_id] and then i would know the value of imageable_type should be set to profile but how do i pass a value for imageable_id ? On Friday, January 22, 2016 at 9:20:04 PM UTC-5, Przemek Kosakowski wrote: > > Are you

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread Przemek Kosakowski
Are you using Paperclip or other gem ? I'm asking because Paperclip resolved this issue and you don't have think about this other fields and values. W dniu 23.01.2016 o 03:17, fugee ohu pisze: How do i get the values for imageable_id and imageable_type inserted into a new picture object? i ca

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
How do i get the values for imageable_id and imageable_type inserted into a new picture object? i can put imageable_type as a hidden field, but imageable_id i don't know On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for

[Rails] polymorphic associations

2016-01-22 Thread fugee ohu
my profile model has_many :pictures, as: :imageable and so do several other models my picture model belongs_to :imageable, polymorphic: true in the pictures table fields imageable_id and imageable_type have both been migrated ok now i create a new_user_profile_picture how are the values for im

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Friday, January 22, 2016 at 5:15:10 PM UTC-5, Walter Lee Davis wrote: > > > > On Jan 22, 2016, at 1:55 PM, fugee ohu > > wrote: > > > > > > > > On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c>

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread Walter Lee Davis
> On Jan 22, 2016, at 1:55 PM, fugee ohu wrote: > > > > On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file

[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-22 Thread David Williams
Matt Jones wrote in post #1180799: They don't have an updated wiki for the gem on Rails 4. Maybe, you and I can put one together to solve this problem for once and for all. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file_field :image %> > > > <%= f.submit %> > > <% end %> >

[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-22 Thread David Williams
Matt Jones wrote in post #1180799: > On Thursday, 21 January 2016 22:21:37 UTC-6, Ruby-Forum.com User wrote: >> class FollowsController < ApplicationController >> >> >> <% end %> >> the @user instead. > The behavior you've described doesn't match the code. The `:locals => { > :user => @user }`

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file_field :image %> > > > <%= f.submit %> > > <% end %> > >

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file_field :image %> > > > <%= f.submit %> > > <% end %> > >

[Rails] Re: Has anyone setup Acts_as_Follower Gem Successfully?

2016-01-22 Thread Matt Jones
On Thursday, 21 January 2016 22:21:37 UTC-6, Ruby-Forum.com User wrote: > > Matt Jones wrote in post #1180578: > > On Tuesday, 12 January 2016 00:12:04 UTC-5, Ruby-Forum.com User wrote: > >> follow to unfollow. > >> > > I'm returning for your advice and help. I've implemented a > Follows_Con

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Friday, January 22, 2016 at 6:11:34 AM UTC-5, Przemek Kosakowski wrote: > > Many pictures for user profile ? I can't agree but okay. If you have many > pictures for one user then you should create Gallery model instead of > Picture. Even on fb user be able to have only one profile picture. >

Re: [Rails] Dynamic Fields and Models Architecture

2016-01-22 Thread Usman Shahid
Ok, i'll explain this with a hypothetical scenario. Suppose the requirement is that we need to create a portal to provide stats of different products available in the market. And suppose you get data periodically from different places in spreadsheets.Each spreadsheet contains data for one kind of p

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread Colin Law
On 22 January 2016 at 10:20, fugee ohu wrote: > On Friday, January 22, 2016 at 5:16:55 AM UTC-5, Colin Law wrote: >> >> On 22 January 2016 at 04:16, fugee ohu wrote: >> > This form raises undefined method `pictures_path' for >> > #<#:0xbb9cb4c> >> > >> > <%= form_for(@picture, :html => { :multipa

[Rails] Pb with render to breaking out of an iframe

2016-01-22 Thread Jer
Hi, I have an application who open an other web site in an iframe where my users have some work to do and have to clic on a button when the job is done. This action send me a get http. In the controller I use this command to breaking out of the iframe : render :text => breakout_path(refinery.sc

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread Przemek Kosakowski
Many pictures for user profile ? I can't agree but okay. If you have many pictures for one user then you should create Gallery model instead of Picture. Even on fb user be able to have only one profile picture. But I don't judge, maybe your solution is effective. W dniu 22.01.2016 o 12:06, fu

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Friday, January 22, 2016 at 6:01:33 AM UTC-5, Przemek Kosakowski wrote: > > many pictures you mean "a few different user profile photo" or you mean > "few copy of the same picture but different size/dimension" ? > > W dniu 22.01.2016 o 11:59, fugee ohu pisze: > > On Thursday, January 21, 2016 a

Re: [Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread Przemek Kosakowski
many pictures you mean "a few different user profile photo" or you mean "few copy of the same picture but different size/dimension" ? W dniu 22.01.2016 o 11:59, fugee ohu pisze: On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: This form raises |undefined method `picture

[Rails] Re: form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:16:40 PM UTC-5, fugee ohu wrote: > > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > > <%= f.file_field :image %> > > > <%= f.submit %> > > <% end %> > >

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread nanaya
Hi, On Fri, Jan 22, 2016, at 19:20, fugee ohu wrote: > On Friday, January 22, 2016 at 5:16:55 AM UTC-5, Colin Law wrote: > > > > On 22 January 2016 at 04:16, fugee ohu > > > wrote: > > > This form raises undefined method `pictures_path' for > > > #<#:0xbb9cb4c> > > > > > > <%= form_for(@pictu

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread Przemek Kosakowski
Look on below situation: class User < ActiveRecord::Base has_one :profile, :autosave => true end class Profile < ActiveRecord::Base belongs_to :user has_attached_file :picture, :styles => { medium: "300x200>", thumb: "100x100>" }, :storage =>

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Friday, January 22, 2016 at 5:16:55 AM UTC-5, Colin Law wrote: > > On 22 January 2016 at 04:16, fugee ohu > > wrote: > > This form raises undefined method `pictures_path' for > > #<#:0xbb9cb4c> > > > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> > > Have you defined t

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
OK But now, the subject is carrierwave Users has_one profile; Profile has_many pictures as :imageable I'm totally lost, I dunno what role in the upload the controller's supposed to play since i have the uploader.rb On Friday, January 22, 2016 at 4:59:26 AM UTC-5, Przemek Kosakowski wrote: > > I

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread Colin Law
On 22 January 2016 at 04:16, fugee ohu wrote: > This form raises undefined method `pictures_path' for > #<#:0xbb9cb4c> > > <%= form_for(@picture, :html => { :multipart => true }) do |f| %> Have you defined that route in routes.rb (via resources: pictures for example)? I agree with Przemek that y

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread Przemek Kosakowski
I see you trying upload some picture, please use this gem [1]. You be able in easy way customize your picture uploader. [1]: paperclip Have you relation between user -> profile -> picture ? W dniu 22.01.2016 o 10:40, fugee ohu pisze: On Thursday, Ja

Re: [Rails] form_for @object with carrierwave upload form

2016-01-22 Thread fugee ohu
On Thursday, January 21, 2016 at 11:40:30 PM UTC-5, Przemek Kosakowski wrote: > > Hello, > > can you show your model and controller file ? > class PicturesController < ApplicationController def index @pictures = Picture.all end def new @picture = current_user.profile.pictures.new