I am using devise with omniauth-facebook, it works fine and I can login and logout.
I encountered two errors
1. when it logs in it append #= to window url
2. When I use javascript sdk, as described in this screencast, it shows following error
Could not authenticate you from Facebook because "Csrf detected".
for the first error, a solution on StackOverflow suggest <script type="text/javascript">if (window.location.hash == '#_=_')window.location.hash = '';</script>
is this right approach to handle this bug and how do I resolve csrf detected error when using javascript sdk.
I'm using draper and in my controller's index action, i have following code
@posts = PostDecorator.approved.order('created_at DESC').includes(:user, :category).page(params[:page]).per(5)and in my view
and I have a partial, _post.html.erb
I want to access methods defined in PostDecorator and UserDecorator in my partial
like
post.post_titleWhat should i need to do to pass @posts variable into my _post partial and access decorator methods
I tried following but failed
<%= render @posts, locals: { post: @posts} %>
and
<%= render @posts, object: @posts %>
Please help me
Thanks :)
I am using devise with omniauth-facebook, it works fine and I can login and logout.
I encountered two errors
for the first error, a solution on StackOverflow suggest
<script type="text/javascript">if (window.location.hash == '#_=_')window.location.hash = '';</script>is this right approach to handle this bug and how do I resolve csrf detected error when using javascript sdk.