Developing a social networking site; acts_as_votable (aka acts_as_likeable)

i’m trying to follow this tutorial https://medium.com/rails-ember-beyond/how-to-build-a-social-network-using-rails-eb31da569233#.cdojrtwvg but on line 1 of _form.html.erb for likes the author says <% if current_user.liked? likeable %> When i ran the app it raised the error undefined method likeable

Undefined method likeable for what object? As I suspect I have
pointed out previously it is always best to copy/paste the complete
error message.

I cannot see where the liked? method is defined. Do you know where it
comes from?

Colin

from the acts_as_followable gem, i was hoping someone would look at the page and tell me their interpretation but I guess that’s not what this group is for

Hi,

Yikes, what does this mean? <%= render ‘likes/form’, likeable: resource %>

Hi,

there’s a “respond to js” at the top of the likes_controller how’s that supposed to work? in your view is it acceptable to redirect to request.referrer or do i wanna modify the dom with javascript to change between like and unlike being displayed

The controller https://github.com/sudharti/socify/blob/master/app/controllers/likes_controller.rb
doesn’t respond with any rendering I don’t wanna redirect I just wanna change the like button to the unlike button so how would i do that

Hi,

Sorry, wrong link.

It's already doing exactly that. Check the respond_to[1] line at the top
of the controller and the corresponding views[2].

[1]
http://api.rubyonrails.org/classes/ActionController/MimeResponds.html#method-i-respond_to

Should be
http://api.rubyonrails.org/v4.1.6/classes/ActionController/MimeResponds/ClassMethods.html#method-i-respond_to

thanks, will read