[Rails] Re: The user index does not display delete links

If your tests are passing, try some debugging.
Check your current_user helper method make sure its working the way its supposed to work.

I would also check sessions to make sure the current user is available.

On Wednesday, July 9, 2014 1:02:09 AM UTC-4, Ruby-Forum.com User wrote:
I am using Ruby 2.0.0 and Rails 4.0.5. I follow "Ruby on Rails tutorial
by Michael Hartl".

I am trying to implement **"The destroy action"** (section 9.4.2).

Administrative users should see delete link

BUT

When i sign in, delete link is not appear. I can't able to solve this
issue.

Test suite run successfully.

>>My application.js file contain:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require_tree .

>> _user.html.erb:

<li>
  <%= gravatar_for user, size: 52 %>
  <%= link_to user.name, user %>
  <% if current_user.admin? && !current_user?(user) %>
    | <%= link_to 'delete', user, method: :delete,
                                  data: { confirm: "You sure?" } %>
  <% end %>
</li>

I attache user_pages_spec.rb file. Please find it.

How to fix this error?

Kind regards

Attachments:
http://www.ruby-forum.com/attachment/9872/user_pages_spec.rb


--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1f7e7f7c-448d-475c-a27f-a95013e091b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.