From 49489a9e205f1056166076341318c3df9a701d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=20Rodr=C3=ADguez?= Date: Sat, 12 Aug 2017 01:03:48 +0200 Subject: [PATCH] Drop :dashboard namespace for route helpers Apply this commit to remove the :dashboard namespace on routes made using the route helper. This means that it is not required anymore to link to a dashboard page using dashboard_video_path, it can be done using video_path. It is not required to use [:dashboard, :videos], :videos can just be used. When linking to a public asset through the dashboard, remember to use the subdomain key in the URL helper to make sure the link points to the appropiate subdomain. --- .../dashboard/opinions_controller.rb | 6 ++--- .../dashboard/playlists_controller.rb | 6 ++--- .../dashboard/topics_controller.rb | 6 ++--- app/controllers/dashboard/users_controller.rb | 8 +++---- .../dashboard/videos_controller.rb | 10 ++++---- app/helpers/dashboard/videos_helper.rb | 24 +++++++++---------- app/views/dashboard/dashboard/index.html.erb | 10 ++++---- app/views/dashboard/opinions/_form.html.erb | 2 +- app/views/dashboard/opinions/edit.html.erb | 8 +++---- app/views/dashboard/opinions/index.html.erb | 10 ++++---- app/views/dashboard/opinions/new.html.erb | 6 ++--- app/views/dashboard/opinions/show.html.erb | 8 +++---- app/views/dashboard/playlists/_form.html.erb | 2 +- app/views/dashboard/playlists/edit.html.erb | 8 +++---- app/views/dashboard/playlists/index.html.erb | 14 +++++------ app/views/dashboard/playlists/new.html.erb | 6 ++--- app/views/dashboard/playlists/show.html.erb | 12 +++++----- app/views/dashboard/playlists/videos.html.erb | 20 ++++++++-------- app/views/dashboard/topics/_form.html.erb | 2 +- app/views/dashboard/topics/edit.html.erb | 8 +++---- app/views/dashboard/topics/index.html.erb | 10 ++++---- app/views/dashboard/topics/new.html.erb | 6 ++--- app/views/dashboard/topics/show.html.erb | 10 ++++---- app/views/dashboard/users/_form.html.erb | 2 +- app/views/dashboard/users/edit.html.erb | 8 +++---- app/views/dashboard/users/index.html.erb | 10 ++++---- app/views/dashboard/users/new.html.erb | 6 ++--- app/views/dashboard/users/show.html.erb | 8 +++---- app/views/dashboard/videos/_form.html.erb | 2 +- app/views/dashboard/videos/edit.html.erb | 8 +++---- app/views/dashboard/videos/index.html.erb | 12 +++++----- app/views/dashboard/videos/new.html.erb | 6 ++--- app/views/dashboard/videos/show.html.erb | 10 ++++---- app/views/layouts/dashboard/_header.html.erb | 10 ++++---- config/routes.rb | 2 +- spec/features/dashboard/dashboard_spec.rb | 6 ++--- spec/features/dashboard/opinions_spec.rb | 16 ++++++------- .../dashboard/playlist_videos_spec.rb | 22 ++++++++--------- spec/features/dashboard/playlists_spec.rb | 16 ++++++------- spec/features/dashboard/topics_spec.rb | 16 ++++++------- spec/features/dashboard/videos_spec.rb | 18 +++++++------- spec/helpers/dashboard/videos_helper_spec.rb | 18 +++++++------- 42 files changed, 199 insertions(+), 199 deletions(-) diff --git a/app/controllers/dashboard/opinions_controller.rb b/app/controllers/dashboard/opinions_controller.rb index f5e72de8..50c94ee8 100644 --- a/app/controllers/dashboard/opinions_controller.rb +++ b/app/controllers/dashboard/opinions_controller.rb @@ -13,7 +13,7 @@ def new def create @opinion = Opinion.new(opinion_params) if @opinion.save - redirect_to [:dashboard, :opinions], notice: t('.created') + redirect_to :opinions, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @opinion.update_attributes(opinion_params) - redirect_to [:dashboard, :opinions], notice: t('.updated') + redirect_to :opinions, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @opinion.destroy! - redirect_to [:dashboard, :opinions], notice: t('.destroyed') + redirect_to :opinions, notice: t('.destroyed') end private diff --git a/app/controllers/dashboard/playlists_controller.rb b/app/controllers/dashboard/playlists_controller.rb index f0610ce4..dfe8aa1f 100644 --- a/app/controllers/dashboard/playlists_controller.rb +++ b/app/controllers/dashboard/playlists_controller.rb @@ -13,7 +13,7 @@ def new def create @playlist = Playlist.new(playlist_params) if @playlist.save - redirect_to [:dashboard, @playlist], notice: t('.created') + redirect_to @playlist, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @playlist.update_attributes(playlist_params) - redirect_to [:dashboard, @playlist], notice: t('.updated') + redirect_to @playlist, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @playlist.destroy! - redirect_to [:dashboard, :playlists], notice: t('.destroyed') + redirect_to :playlists, notice: t('.destroyed') end def videos diff --git a/app/controllers/dashboard/topics_controller.rb b/app/controllers/dashboard/topics_controller.rb index b6d24782..d7e2801b 100644 --- a/app/controllers/dashboard/topics_controller.rb +++ b/app/controllers/dashboard/topics_controller.rb @@ -13,7 +13,7 @@ def new def create @topic = Topic.new(topic_params) if @topic.save - redirect_to [:dashboard, @topic], notice: t('.created') + redirect_to @topic, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @topic.update_attributes(topic_params) - redirect_to [:dashboard, @topic], notice: t('.updated') + redirect_to @topic, notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @topic.destroy! - redirect_to [:dashboard, :topics], notice: t('.destroyed') + redirect_to :topics, notice: t('.destroyed') end private diff --git a/app/controllers/dashboard/users_controller.rb b/app/controllers/dashboard/users_controller.rb index e3e7cdad..be157d23 100644 --- a/app/controllers/dashboard/users_controller.rb +++ b/app/controllers/dashboard/users_controller.rb @@ -13,7 +13,7 @@ def new def create @user = User.new(user_params) if @user.save - redirect_to [:dashboard, @user], notice: t('.created') + redirect_to @user, notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @user.update_attributes(user_params) - redirect_to [:dashboard, @user], notice: t('.updated') + redirect_to @user, notice: t('.updated') else render :edit end @@ -30,9 +30,9 @@ def update def destroy if @user != current_user @user.destroy! - redirect_to [:dashboard, :users], notice: t('.destroyed') + redirect_to :users, notice: t('.destroyed') else - redirect_to [:dashboard, :users], error: t('.current_user') + redirect_to :users, error: t('.current_user') end end diff --git a/app/controllers/dashboard/videos_controller.rb b/app/controllers/dashboard/videos_controller.rb index 199aebc2..e351fe13 100644 --- a/app/controllers/dashboard/videos_controller.rb +++ b/app/controllers/dashboard/videos_controller.rb @@ -13,7 +13,7 @@ def new def create @video = Video.new(video_params) if @video.save - redirect_to [:dashboard, @video.playlist, @video], notice: t('.created') + redirect_to [@video.playlist, @video], notice: t('.created') else render :new end @@ -21,7 +21,7 @@ def create def update if @video.update_attributes(video_params) - redirect_to [:dashboard, @video.playlist, @video], notice: t('.updated') + redirect_to [@video.playlist, @video], notice: t('.updated') else render :edit end @@ -29,7 +29,7 @@ def update def destroy @video.destroy! - redirect_to [:dashboard, :videos], notice: t('.destroyed') + redirect_to :videos, notice: t('.destroyed') end def move @@ -37,11 +37,11 @@ def move if params[:direction] == "up" @video.move_higher format.json { render json: { position: @video.position, direction: "up" } } - format.html { redirect_to [:videos, :dashboard, @video.playlist], notice: t('.moved') } + format.html { redirect_to [:videos, @video.playlist], notice: t('.moved') } elsif params[:direction] == "down" @video.move_lower format.json { render json: { position: @video.position, direction: "down" } } - format.html { redirect_to [:videos, :dashboard, @video.playlist], notice: t('.moved') } + format.html { redirect_to [:videos, @video.playlist], notice: t('.moved') } end end end diff --git a/app/helpers/dashboard/videos_helper.rb b/app/helpers/dashboard/videos_helper.rb index 18ed1db8..aebe9b22 100644 --- a/app/helpers/dashboard/videos_helper.rb +++ b/app/helpers/dashboard/videos_helper.rb @@ -1,25 +1,25 @@ module Dashboard::VideosHelper - def dashboard_video_path(video, options = {}) - dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def video_path(video, options = {}) + playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def edit_dashboard_video_path(video, options = {}) - edit_dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def edit_video_path(video, options = {}) + edit_playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def move_dashboard_video_path(video, options = {}) - move_dashboard_playlist_video_path(video, options.merge(playlist_id: video.playlist)) + def move_video_path(video, options = {}) + move_playlist_video_path(video, options.merge(playlist_id: video.playlist)) end - def dashboard_video_url(video, options = {}) - dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def video_url(video, options = {}) + playlist_video_url(video, options.merge(playlist_id: video.playlist)) end - def edit_dashboard_video_url(video, options = {}) - edit_dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def edit_video_url(video, options = {}) + edit_playlist_video_url(video, options.merge(playlist_id: video.playlist)) end - def move_dashboard_video_url(video, options = {}) - move_dashboard_playlist_video_url(video, options.merge(playlist_id: video.playlist)) + def move_video_url(video, options = {}) + move_playlist_video_url(video, options.merge(playlist_id: video.playlist)) end end diff --git a/app/views/dashboard/dashboard/index.html.erb b/app/views/dashboard/dashboard/index.html.erb index 6b980e02..dce23b6c 100644 --- a/app/views/dashboard/dashboard/index.html.erb +++ b/app/views/dashboard/dashboard/index.html.erb @@ -10,30 +10,30 @@

<%= @videos %>

<%= t('.videos', count: @videos) %>

-

<%= link_to t('.manage_videos'), [:dashboard, :videos], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_videos'), :videos, class: 'btn btn-default btn-block' %>

<%= @playlists %>

<%= t('.playlists', count: @playlists) %>

-

<%= link_to t('.manage_playlists'), [:dashboard, :playlists], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_playlists'), :playlists, class: 'btn btn-default btn-block' %>

<%= @topics %>

<%= t('.topics', count: @topics) %>

-

<%= link_to t('.manage_topics'), [:dashboard, :topics], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_topics'), :topics, class: 'btn btn-default btn-block' %>

<%= @users %>

<%= t('.users', count: @users) %>

-

<%= link_to t('.manage_users'), [:dashboard, :users], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_users'), :users, class: 'btn btn-default btn-block' %>

<%= @opinions %>

<%= t('.opinions', count: @opinions) %>

-

<%= link_to t('.manage_opinions'), [:dashboard, :opinions], class: 'btn btn-default btn-block' %>

+

<%= link_to t('.manage_opinions'), :opinions, class: 'btn btn-default btn-block' %>

\ No newline at end of file diff --git a/app/views/dashboard/opinions/_form.html.erb b/app/views/dashboard/opinions/_form.html.erb index aa89bc5f..e09d6a2a 100644 --- a/app/views/dashboard/opinions/_form.html.erb +++ b/app/views/dashboard/opinions/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @opinion] do |form| %> +<%= simple_form_for @opinion do |form| %> <%= form.input :from %> <%= form.input :message, as: :text %> <%= form.input :url, as: :url %> diff --git a/app/views/dashboard/opinions/edit.html.erb b/app/views/dashboard/opinions/edit.html.erb index c183a8a2..91a4dc12 100644 --- a/app/views/dashboard/opinions/edit.html.erb +++ b/app/views/dashboard/opinions/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @opinion], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @opinion, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/index.html.erb b/app/views/dashboard/opinions/index.html.erb index 1efc726e..e9934c74 100644 --- a/app/views/dashboard/opinions/index.html.erb +++ b/app/views/dashboard/opinions/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.opinions') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_opinion'), [:new, :dashboard, :opinion], class: 'btn btn-success' %> + <%= link_to t('.new_opinion'), [:new, :opinion], class: 'btn btn-success' %> <% end %> @@ -20,10 +20,10 @@ <% @opinions.each do |opinion| %> - + <% end %> diff --git a/app/views/dashboard/opinions/new.html.erb b/app/views/dashboard/opinions/new.html.erb index 749fde0b..c6c187d0 100644 --- a/app/views/dashboard/opinions/new.html.erb +++ b/app/views/dashboard/opinions/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_opinion') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :opinions], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :opinions, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/opinions/show.html.erb b/app/views/dashboard/opinions/show.html.erb index c1a0bfb0..ebb23675 100644 --- a/app/views/dashboard/opinions/show.html.erb +++ b/app/views/dashboard/opinions/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @opinion %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @opinion], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @opinion], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @opinion], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @opinion, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to opinion.from, [:dashboard, opinion] %><%= link_to opinion.from, opinion %> - <%= link_to t('.edit'), [:edit, :dashboard, opinion], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, opinion], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, opinion], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), opinion, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
diff --git a/app/views/dashboard/playlists/_form.html.erb b/app/views/dashboard/playlists/_form.html.erb index 61e73c88..e21fca17 100644 --- a/app/views/dashboard/playlists/_form.html.erb +++ b/app/views/dashboard/playlists/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @playlist] do |form| %> +<%= simple_form_for @playlist do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/playlists/edit.html.erb b/app/views/dashboard/playlists/edit.html.erb index b86016ee..78696977 100644 --- a/app/views/dashboard/playlists/edit.html.erb +++ b/app/views/dashboard/playlists/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @playlist], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @playlist, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/index.html.erb b/app/views/dashboard/playlists/index.html.erb index b4bfc54f..4c520b24 100644 --- a/app/views/dashboard/playlists/index.html.erb +++ b/app/views/dashboard/playlists/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.playlists') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_playlist'), [:new, :dashboard, :playlist], class: 'btn btn-success' %> + <%= link_to t('.new_playlist'), [:new, :playlist], class: 'btn btn-success' %> <% end %>
@@ -22,12 +22,12 @@ <% @playlists.each do |playlist| %> - - - + + + <% end %> diff --git a/app/views/dashboard/playlists/new.html.erb b/app/views/dashboard/playlists/new.html.erb index 09d24b13..a65cbe59 100644 --- a/app/views/dashboard/playlists/new.html.erb +++ b/app/views/dashboard/playlists/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_playlist') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :playlists], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :playlists, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/playlists/show.html.erb b/app/views/dashboard/playlists/show.html.erb index 47925b0e..5b51e303 100644 --- a/app/views/dashboard/playlists/show.html.erb +++ b/app/views/dashboard/playlists/show.html.erb @@ -1,16 +1,16 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.videos'), [:videos, :dashboard, @playlist], class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.videos'), [:videos, @playlist], class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to playlist.title, [:dashboard, playlist] %><%= link_to playlist.topic.title, [:dashboard, playlist.topic] rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, :dashboard, playlist] %><%= link_to playlist.title, playlist %><%= link_to playlist.topic.title, playlist.topic rescue t('.no_topic') %><%= link_to playlist.videos.length, [:videos, playlist] %> - <%= link_to t('.edit'), [:edit, :dashboard, playlist], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, playlist], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, playlist], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), playlist, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -28,7 +28,7 @@ - + diff --git a/app/views/dashboard/playlists/videos.html.erb b/app/views/dashboard/playlists/videos.html.erb index 97ba3a92..16630755 100644 --- a/app/views/dashboard/playlists/videos.html.erb +++ b/app/views/dashboard/playlists/videos.html.erb @@ -1,17 +1,17 @@ <% content_for :header do %>

<%= @playlist %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.back'), [:dashboard, @playlist], class: 'btn btn-default' %> - <%= link_to t('.edit'), [:edit, :dashboard, @playlist], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @playlist], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.back'), @playlist, class: 'btn btn-default' %> + <%= link_to t('.edit'), [:edit, @playlist], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @playlist, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= t('.topic') %><%= link_to @playlist.topic.title, [:dashboard, @playlist.topic] rescue t('.no_topic') %><%= link_to @playlist.topic.title, @playlist.topic rescue t('.no_topic') %>
<%= t('.card') %>
@@ -27,13 +27,13 @@ <% @videos.each do |video| %> - + <% end %> diff --git a/app/views/dashboard/topics/_form.html.erb b/app/views/dashboard/topics/_form.html.erb index 957f340a..cd2ba5ad 100644 --- a/app/views/dashboard/topics/_form.html.erb +++ b/app/views/dashboard/topics/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @topic] do |form| %> +<%= simple_form_for @topic do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :color do %> diff --git a/app/views/dashboard/topics/edit.html.erb b/app/views/dashboard/topics/edit.html.erb index 5047a4c9..391172fb 100644 --- a/app/views/dashboard/topics/edit.html.erb +++ b/app/views/dashboard/topics/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @topic], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @topic, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/index.html.erb b/app/views/dashboard/topics/index.html.erb index 9daac209..7fbccb9f 100644 --- a/app/views/dashboard/topics/index.html.erb +++ b/app/views/dashboard/topics/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.topics') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_topic'), [:new, :dashboard, :topic], class: 'btn btn-success' %> + <%= link_to t('.new_topic'), [:new, :topic], class: 'btn btn-success' %> <% end %>
<%= video.position %><%= link_to video.title, [:dashboard, video] %><%= link_to video.title, video %> - <%= button_to t('.up'), move_dashboard_video_path(video), params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> - <%= button_to t('.down'), move_dashboard_video_path(video), params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> + <%= button_to t('.up'), [:move, video], params: { direction: 'up' }, remote: true, method: :put, class: 'video-move-up btn btn-xs btn-info' %> + <%= button_to t('.down'), [:move, video], params: { direction: 'down' }, remote: true, method: :put, class: 'video-move-down btn btn-xs btn-info' %> - <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %> + <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %>
@@ -21,11 +21,11 @@ <% @topics.each do |topic| %> - + <% end %> diff --git a/app/views/dashboard/topics/new.html.erb b/app/views/dashboard/topics/new.html.erb index 68bf13ee..7bf32975 100644 --- a/app/views/dashboard/topics/new.html.erb +++ b/app/views/dashboard/topics/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_topic') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :topics], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :topics, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/topics/show.html.erb b/app/views/dashboard/topics/show.html.erb index d128b367..8752ddc0 100644 --- a/app/views/dashboard/topics/show.html.erb +++ b/app/views/dashboard/topics/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @topic %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @topic], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @topic], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @topic], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @topic, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to topic.title, [:dashboard, topic] %><%= link_to topic.title, topic %> <%= topic.playlists.count %> - <%= link_to t('.edit'), [:edit, :dashboard, topic], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, topic], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, topic], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), topic, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -34,7 +34,7 @@ diff --git a/app/views/dashboard/users/_form.html.erb b/app/views/dashboard/users/_form.html.erb index e3e50db6..6add47b4 100644 --- a/app/views/dashboard/users/_form.html.erb +++ b/app/views/dashboard/users/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @user] do |form| %> +<%= simple_form_for @user do |form| %> <%= form.input :email %> <%= form.input :password %> <%= form.input :password_confirmation %> diff --git a/app/views/dashboard/users/edit.html.erb b/app/views/dashboard/users/edit.html.erb index 8d1c5ee6..1880bdf4 100644 --- a/app/views/dashboard/users/edit.html.erb +++ b/app/views/dashboard/users/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @user], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @user, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/index.html.erb b/app/views/dashboard/users/index.html.erb index 08b9d0f1..7fe9988f 100644 --- a/app/views/dashboard/users/index.html.erb +++ b/app/views/dashboard/users/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.users') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_user'), [:new, :dashboard, :user], class: 'btn btn-success' %> + <%= link_to t('.new_user'), [:new, :user], class: 'btn btn-success' %> <% end %>
    <% @topic.playlists.each do |playlist| %> -
  • <%= link_to playlist.title, [:dashboard, playlist] %>
  • +
  • <%= link_to playlist.title, playlist %>
  • <% end %>
@@ -21,11 +21,11 @@ <% @users.each do |user| %> - + <% end %> diff --git a/app/views/dashboard/users/new.html.erb b/app/views/dashboard/users/new.html.erb index a1827f18..8e86996f 100644 --- a/app/views/dashboard/users/new.html.erb +++ b/app/views/dashboard/users/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_user') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :users], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :users, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/users/show.html.erb b/app/views/dashboard/users/show.html.erb index 57758dd7..7894a1f4 100644 --- a/app/views/dashboard/users/show.html.erb +++ b/app/views/dashboard/users/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @user %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @user], class: 'btn btn-success' %> - <%= button_to t('.destroy'), [:dashboard, @user], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> + <%= link_to t('.edit'), [:edit, @user], class: 'btn btn-success' %> + <%= button_to t('.destroy'), @user, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == @user %> <% end %>
<%= link_to user.email, [:dashboard, user] %><%= link_to user.email, user %> <%= user.last_sign_in_at %> - <%= link_to t('.edit'), [:edit, :dashboard, user], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, user], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %> + <%= link_to t('.edit'), [:edit, user], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), user, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') }, disabled: current_user == user %>
diff --git a/app/views/dashboard/videos/_form.html.erb b/app/views/dashboard/videos/_form.html.erb index f5f08878..2a1cf556 100644 --- a/app/views/dashboard/videos/_form.html.erb +++ b/app/views/dashboard/videos/_form.html.erb @@ -1,4 +1,4 @@ -<%= simple_form_for [:dashboard, @video] do |form| %> +<%= simple_form_for @video do |form| %> <%= form.input :title %> <%= form.input :description, as: :text %> <%= form.input :youtube_id %> diff --git a/app/views/dashboard/videos/edit.html.erb b/app/views/dashboard/videos/edit.html.erb index d607609c..9a83921a 100644 --- a/app/views/dashboard/videos/edit.html.erb +++ b/app/views/dashboard/videos/edit.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, @video], class: 'btn btn-default' %> + <%= link_to t('.cancel'), @video, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/index.html.erb b/app/views/dashboard/videos/index.html.erb index 06d727c9..4c0c8c64 100644 --- a/app/views/dashboard/videos/index.html.erb +++ b/app/views/dashboard/videos/index.html.erb @@ -1,13 +1,13 @@ <% content_for :header do %>

<%= t('.videos') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.new_video'), [:new, :dashboard, :video], class: 'btn btn-success' %> + <%= link_to t('.new_video'), [:new, :video], class: 'btn btn-success' %> <% end %>
@@ -23,13 +23,13 @@ <% @videos.each do |video| %> - - + + <% end %> diff --git a/app/views/dashboard/videos/new.html.erb b/app/views/dashboard/videos/new.html.erb index 5bf2b56a..fc398846 100644 --- a/app/views/dashboard/videos/new.html.erb +++ b/app/views/dashboard/videos/new.html.erb @@ -1,14 +1,14 @@ <% content_for :header do %>

<%= t('.new_video') %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.cancel'), [:dashboard, :videos], class: 'btn btn-default' %> + <%= link_to t('.cancel'), :videos, class: 'btn btn-default' %> <% end %> <%= render 'form' %> \ No newline at end of file diff --git a/app/views/dashboard/videos/show.html.erb b/app/views/dashboard/videos/show.html.erb index a9b39170..bdc7033a 100644 --- a/app/views/dashboard/videos/show.html.erb +++ b/app/views/dashboard/videos/show.html.erb @@ -1,15 +1,15 @@ <% content_for :header do %>

<%= @video %>

<% end %> <% content_for :toolbar do %> - <%= link_to t('.edit'), [:edit, :dashboard, @video], class: 'btn btn-default' %> - <%= button_to t('.destroy'), [:dashboard, @video], method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, @video], class: 'btn btn-default' %> + <%= button_to t('.destroy'), @video, method: :delete, class: 'btn btn-danger', data: { confirm: t('.really_destroy') } %> <% end %>
<%= link_to video.title, [:dashboard, video] %><%= link_to video.playlist.title, [:dashboard, video.playlist] %><%= link_to video.title, video %><%= link_to video.playlist.title, video.playlist %> <%= l video.published_at, format: :long %> <%= distance_of_time_in_words video.updated_at, DateTime.now %> - <%= link_to t('.edit'), [:edit, :dashboard, video], class: 'btn btn-xs btn-default' %> - <%= button_to t('.destroy'), [:dashboard, video], method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %> + <%= link_to t('.edit'), [:edit, video], class: 'btn btn-xs btn-default' %> + <%= button_to t('.destroy'), video, method: :delete, class: 'btn btn-xs btn-danger', data: { confirm: t('.really_destroy') } %>
@@ -31,7 +31,7 @@ - + diff --git a/app/views/layouts/dashboard/_header.html.erb b/app/views/layouts/dashboard/_header.html.erb index c210b60e..d358795d 100644 --- a/app/views/layouts/dashboard/_header.html.erb +++ b/app/views/layouts/dashboard/_header.html.erb @@ -8,14 +8,14 @@ - <%= link_to 'makigas', :dashboard, class: 'navbar-brand'%> + <%= link_to 'makigas', :root, class: 'navbar-brand'%>
<%= t('.playlist') %><%= link_to @video.playlist.title, [:dashboard, @video.playlist] %><%= link_to @video.playlist.title, @video.playlist %>
<%= t('.published_at') %>