0

I can get

<% if current_user %>

to work. However I would like to be able to use statments like

<% if current_user=(user) %>

or something like that. How can I do this with Sorcery?

0

1 Answer 1

1

You're trying to use an assignment operator where you need a comparison operator. It should probably be like this:

<%= if @user == current_user %>
  <!-- Do stuff -->
<% end %>

Remember you need to get access to the @user instance variable by assigning it in your controller action:

class UsersController < ApplicationController
  def show
    @user = User.find(params[:id])
  end
end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.