Idea To App!
How far are you for project 1?
-
0-30%
-
30-60%
-
60-90%
-
90-100%
You know
how to make...
- Static pages
- Models
- Migrations
- Controllers
- Views
Which route will allow this form to render in pokemons/new.html.erb?
Assume @pokemon = Pokemon.new
-
post '/pokemons', to: 'pokemons#create', as: :pokemons
-
get '/pokemons/new', to: 'pokemons#new', as: :pokemons
-
patch '/pokemons', to: 'pokemons#create', as: :pokemons
-
post '/pokemons/new', to: 'pokemons#new', as: :new_pokemon
= simple_form_for @pokemon do |f| = f.input :name = f.button :submit
Routes and forms???
= simple_form_for @pokemon do |f| ...
= simple_form_for @pokemon, url: pokemons_path(@pokemon), method: :post do |f| ...
is equal to...
Post to pokemons_path (new resource) or patch to pokemon_path (updating resource) behind the scenes.
resources :pokemons does all this already!
Now...
We turn an idea into an app from start to finish!
Next Week...
- More app development
Quitter!
Introducing...
Quitter
- Twitter for quitters
Idea
- People can post about what they are quitting
- Admins moderate posts to make sure they are appropriate
For the future!
What do we need?
- Easiest to think about models first
- User model
- Name, email
- Needs authentication (sound familiar?)
- has many Quits
- Quit model
- Text
- belongs to User
Roadmap
Step 1
User/Post models
Step 2
User auth
Step 3
Validations + Associations
Roadmap
Step 4
Post Index, New, Create, Show
Step 5
Edit, Update Quit
Step 6
New, Create Quit
Whew...
What are major security flaws with this app currently?
- Users can edit each other's quits
- Users can delete other people's quits
- A nonuser of the site can transfer quits from one User to another
- A nonuser of the site can create quits for himself
- (a), (b) only
- (a), (c) only
- (a) only
- All of the choices are security flaws
No Authorization!
- So anyone can do anything they want :(
- Think about how you could limit the tasks a user can do
- Will see again when we create admins!
Logistics
- Project 1 due next Friday (3/18) at 11:59pm!
- Project 2 Spec Next Week
- Find a group of up to 3-4 people!
- Will be making a fairly complex Rails app based on an idea of your own
The end.
Spring 2016 - Week 6: Idea to App
By Rails Decal
Spring 2016 - Week 6: Idea to App
- 1,144