diff --git a/app.rb b/app.rb index b1f74e9..9143c44 100644 --- a/app.rb +++ b/app.rb @@ -2,4 +2,18 @@ class App < Sinatra::Base -end \ No newline at end of file + get '/' do + erb :index + end + + get '/new' do + erb :create_puppy + end + + post '/puppy' do + @name = params['name'] + @age = params['age'] + @breed = params['breed'] + erb :display_puppy + end +end diff --git a/models/puppy.rb b/models/puppy.rb index e69de29..2b54bed 100644 --- a/models/puppy.rb +++ b/models/puppy.rb @@ -0,0 +1,9 @@ +class Puppy + attr_accessor :name, :breed, :age + + def initialize(name, breed, age) + @name = name + @breed = breed + @age = age + end +end diff --git a/views/create_puppy.erb b/views/create_puppy.erb index e69de29..aca3770 100644 --- a/views/create_puppy.erb +++ b/views/create_puppy.erb @@ -0,0 +1,9 @@ +
diff --git a/views/display_puppy.erb b/views/display_puppy.erb index e69de29..6fbd83f 100644 --- a/views/display_puppy.erb +++ b/views/display_puppy.erb @@ -0,0 +1,5 @@ + +Puppy Name: <%= @name %>
+Puppy Breed: <%= @breed %>
+Puppy Age: <%= @age %>
+ diff --git a/views/index.erb b/views/index.erb index e69de29..102b9e9 100644 --- a/views/index.erb +++ b/views/index.erb @@ -0,0 +1,11 @@ + + + +