refactoring
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
class CoursesController < TissCrawlerController
|
||||
class CoursesController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class PeopleController < TissCrawlerController
|
||||
class PeopleController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class ProjectsController < TissCrawlerController
|
||||
class ProjectsController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class ThesesController < TissCrawlerController
|
||||
class ThesesController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
@@ -25,4 +25,13 @@ class TissCrawlerController < ApplicationController
|
||||
|
||||
end
|
||||
|
||||
require 'tiss/tiss_crawler'
|
||||
|
||||
def show_basic
|
||||
result = TissCrawler.search(params)
|
||||
@people = result.map { |person| Tiss::Person.new(person) }
|
||||
# render(people_show_path, detail: false)
|
||||
render template: people_show_basic_path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Courses#show basic</h1>
|
||||
<p>Find me in app/views/courses/show.html.erb</p>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Courses#show detailed</h1>
|
||||
<p>Find me in app/views/courses/show.html.erb</p>
|
||||
@@ -1,11 +1,3 @@
|
||||
<h1>People#index</h1>
|
||||
<p>Find me in app/views/people/index.html.erb</p>
|
||||
|
||||
<%= form_tag('/tisscrawler/search', :method => "get") do %>
|
||||
<%= hidden_field_tag(:context, 'People') %>
|
||||
<%= hidden_field_tag(:api, '/api/person/v22/psuche') %>
|
||||
<%= hidden_field_tag(:search_parameter, 'q') %>
|
||||
<%= label_tag(:search_term, "Search for:") %>
|
||||
<%= text_field_tag(:search_term) %>
|
||||
<%= submit_tag("Search") %>
|
||||
<% end %>
|
||||
@@ -1,4 +0,0 @@
|
||||
<h1>People#show detailed</h1>
|
||||
<p>Find me in app/views/people/show.html.erb</p>
|
||||
|
||||
<%= @people %>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Projects#show basic</h1>
|
||||
<p>Find me in app/views/projects/show.html.erb</p>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Projects#show detailed</h1>
|
||||
<p>Find me in app/views/projects/show.html.erb</p>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Theses#show basic</h1>
|
||||
<p>Find me in app/views/theses/show.html.erb</p>
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Theses#show detailed</h1>
|
||||
<p>Find me in app/views/theses/show.html.erb</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
<%= form_tag('/tiss_crawler/search', :method => "get") do %>
|
||||
<%= hidden_field_tag(:context, 'People') %>
|
||||
<%= hidden_field_tag(:api, '/api/person/v22/psuche') %>
|
||||
<%= hidden_field_tag(:search_parameter, 'q') %>
|
||||
<%= label_tag(:search_term, "Search for:") %>
|
||||
<%= text_field_tag(:search_term) %>
|
||||
<%= submit_tag("Search") %>
|
||||
<% end %>
|
||||
@@ -1,10 +1,8 @@
|
||||
<h1>People#show basic</h1>
|
||||
|
||||
This is the result for your basic people search:
|
||||
|
||||
<% @people.each do |person| %>
|
||||
<p>
|
||||
<%= person.first_name %>
|
||||
<%= person.last_name %>
|
||||
<%= button_to people_show_detailed_path %> [add to favs]
|
||||
</p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user