summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2017-09-24 13:53:09 -0600
committermo <mo.khan@gmail.com>2017-09-24 13:53:09 -0600
commit4887ba54da7ff8a25347b58c4a426cb5cf1dee3b (patch)
tree5327f65dafd3f8a4881053d5da0d601f4c2e918a /app/views
parentdc702a89811e866eec20cc43763096dddf4a41fe (diff)
render categories as backbone collection in html page.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/cakes/_show.html.erb2
-rw-r--r--app/views/cakes/index.html.erb2
-rw-r--r--app/views/layouts/_header.html.erb2
-rw-r--r--app/views/my/kitchens/show.html.erb3
4 files changed, 6 insertions, 3 deletions
diff --git a/app/views/cakes/_show.html.erb b/app/views/cakes/_show.html.erb
index c0555eab..9c2bb197 100644
--- a/app/views/cakes/_show.html.erb
+++ b/app/views/cakes/_show.html.erb
@@ -2,7 +2,7 @@
<div class="col">
<h1><%= link_to @creation.name, cake_path(@creation) %></h1>
<p>By <%= link_to @creation.user.name, profile_path(@creation.user) %></p>
- <% if user_signed_in? && current_user != @creation.user %>
+ <% if current_user? && current_user != @creation.user %>
<% if current_user.already_likes(@creation) %>
<i class="fa fa-star fa-4x float-right"></i>
<% else %>
diff --git a/app/views/cakes/index.html.erb b/app/views/cakes/index.html.erb
index c8a0a13a..d492a4d1 100644
--- a/app/views/cakes/index.html.erb
+++ b/app/views/cakes/index.html.erb
@@ -2,7 +2,7 @@
<% provide(:search_path, cakes_path) %>
<% provide(:container_class, 'container') %>
-<% unless user_signed_in? %>
+<% unless current_user? %>
<div class="row jumbotron">
<div class="col text-center">
<%= image_tag "cakeside-logo.png", alt: "CakeSide", class: "img-fluid" %>
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index 9fd798a0..8d150b1a 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -15,7 +15,7 @@
<li class="nav-item <%= "active" if params["controller"] == "tutorials" %>">
<%= link_to "Tutorials", tutorials_path(q: params[:q]), class: 'nav-link' %>
</li>
- <% if user_signed_in? %>
+ <% if current_user? %>
<li class="nav-item dropdown">
<%= link_to my_dashboard_path, id: 'navbarDropdownMenuLink', class: 'nav-link dropdown-toggle', data: { toggle: 'dropdown' }, 'aria-haspopup'=>"true", 'aria-expanded'=>"false" do %>
<%= current_user.name %>
diff --git a/app/views/my/kitchens/show.html.erb b/app/views/my/kitchens/show.html.erb
index f241562f..195a8d94 100644
--- a/app/views/my/kitchens/show.html.erb
+++ b/app/views/my/kitchens/show.html.erb
@@ -1,6 +1,9 @@
<% provide(:title, "Kitchen") -%>
<%= content_for :javascript do -%>
<%= javascript_tag do %>
+ csx.Categories = new Backbone.Collection(<%= raw @categories.to_json %>);
+
+ <%# backbone_collection_for @categories %>
var ALL_TAGS = <%= raw @tags.pluck(:name) %>;
csx.initialize({ access_token: '<%= current_user.authentication_token %>' });
<% end %>