diff --git a/app/views/items/index.html.erb b/app/views/items/index.html.erb index 295f9b1..05244a4 100644 --- a/app/views/items/index.html.erb +++ b/app/views/items/index.html.erb @@ -25,7 +25,7 @@ Add to cart <%= link_to 'Show', item, :class => "button", :role => "button" %> - <% if user_signed_in? %> + <% if session[:login] == 1 %> <%= link_to 'Edit', edit_item_path(item), :class => "button", :role => "button" %> <%= link_to 'Destroy', item, method: :delete, data: { confirm: 'Are you sure?' }, :class => "button", :role => "button" %> <% end %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index ebc6143..66955bc 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -10,12 +10,19 @@
  • <%= link_to "Cart", cart_path %>
  • <% if user_signed_in? %> -
  • Hi <%= current_user.email %>
  • +
  • <%= link_to 'Edit Profile', edit_user_registration_path %>
  • <%= link_to 'Sign Out', destroy_user_session_path, :method =>:delete %>
  • <% else %>
  • <%= link_to 'Register', new_user_registration_path %>
  • <%= link_to 'Sign In', new_user_session_path %>
  • <% end %> + + <% if session[:login] == 1 %> +
  • <%= link_to "Admin Logout", logout_path %>
  • + <% else %> +
  • <%= link_to "Admin Login", login_path %>
  • + <% end %> + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a9012f2..ea3799a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - Gamestore + GameLand <%= csrf_meta_tags %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> diff --git a/db/development.sqlite3 b/db/development.sqlite3 index d4ab210..97109f1 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ