Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Can delete status when logged out

Howdy?

I just followed the beginners ruby on rails tutorial (the first for status updates).

I thought I had followed exactly as per tutorial , but i found that I can delete statuses even when not logged in. So I can delete statuses of other users.

Anyone have the same bug or did i miss something?

3 Answers

Giann Wilkerson
Giann Wilkerson
6,897 Points

Hi Simon,

Guys correct me if im wrong although, I believe its a step later on in the tutorial. Im in the "Creating Friendships" stage and I have not come across the fix yet. Its either corrected later in the tutorial (much later) or its something you may have to right the code for yourself.

hopefully this helps!

I've found the course where the span class of admin is used.

The following does not hide the edit and delete:

index.html.erb

<span class="admin"> <td><%= link_to 'Edit', edit_event_path(event) %></td> <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure you want to delete this event?' } %></td> </span>

events.css.scss

.event .admin { display: none; }

not sure whats going on

Lenny Pistorio
Lenny Pistorio
4,208 Points

I have the same problem Simon. Have you sorted it out yet?