Add projects
This commit is contained in:
10
app/controllers/projects_controller.rb
Normal file
10
app/controllers/projects_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class ProjectsController < ApplicationController
|
||||
|
||||
def index
|
||||
@projects = Project.all
|
||||
end
|
||||
|
||||
def show
|
||||
@project = Project.find(params[:id])
|
||||
end
|
||||
end
|
||||
2
app/helpers/projects_helper.rb
Normal file
2
app/helpers/projects_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ProjectsHelper
|
||||
end
|
||||
2
app/models/project.rb
Normal file
2
app/models/project.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Project < ApplicationRecord
|
||||
end
|
||||
5
app/views/projects/index.html.erb
Normal file
5
app/views/projects/index.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Projects</h1>
|
||||
|
||||
<% @projects.each do |project| %>
|
||||
<li><%= link_to project.name, project_path(project) %></li>
|
||||
<% end %>
|
||||
2
app/views/projects/show.html.erb
Normal file
2
app/views/projects/show.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1><%= @project.name %></h1>
|
||||
<%= link_to "Back", projects_path %>
|
||||
Reference in New Issue
Block a user