diff --git a/app/assets/javascripts/conference.js b/app/assets/javascripts/conference.js new file mode 100644 index 00000000..dee720fa --- /dev/null +++ b/app/assets/javascripts/conference.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/conference.css.scss b/app/assets/stylesheets/conference.css.scss new file mode 100644 index 00000000..20356924 --- /dev/null +++ b/app/assets/stylesheets/conference.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the conference controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/conference_controller.rb b/app/controllers/conference_controller.rb index 85f72ea0..fd1fe19c 100644 --- a/app/controllers/conference_controller.rb +++ b/app/controllers/conference_controller.rb @@ -1,5 +1,5 @@ class ConferenceController < ApplicationController def show - @conference = Conference.find_by_title(params[:conference_id]) + @conference = Conference.find_by_title(params[:id]) end end diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb new file mode 100644 index 00000000..26a58bdd --- /dev/null +++ b/app/helpers/conference_helper.rb @@ -0,0 +1,2 @@ +module ConferenceHelper +end diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index b4478c89..59755fd6 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -24,7 +24,7 @@ = simple_format(conference.venue.description, class: 'lead') .col-md-2 .btn-group-vertical - = link_to "View Conference", conference_show_path(conference.title), :class => " btn btn-default" + = link_to "View Conference", conference_path(conference.title), :class => " btn btn-default" - if conference.registration_open? - if conference.user_registered?(current_user) = link_to "Modify Registration", register_conference_path(conference.short_title), :class =>"btn btn-default" diff --git a/config/routes.rb b/config/routes.rb index bbf43ce6..88b8b9b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -46,8 +46,7 @@ Osem::Application.routes.draw do end end - resources :conference, :only => [] do - get '/show' => 'conference#show' + resources :conference, :only => [:show] do resources :proposal do resources :event_attachment, :controller => "event_attachments" put "/confirm" => "proposal#confirm" diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb new file mode 100644 index 00000000..1cc61fe5 --- /dev/null +++ b/spec/controllers/conference_controller_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe ConferenceController do + + describe "GET 'show'" do + it "returns http success" do + get :show, :id => 'sample' + expect(response).to be_success + end + end + +end diff --git a/spec/helpers/conference_helper_spec.rb b/spec/helpers/conference_helper_spec.rb new file mode 100644 index 00000000..fe33f1b6 --- /dev/null +++ b/spec/helpers/conference_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the ConferenceHelper. For example: +# +# describe ConferenceHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +describe ConferenceHelper do + pending "add some examples to (or delete) #{__FILE__}" +end