Talk I gave to Austin All Girl Hacknite. We installed rails and built the app step by step. We had alot of brand new to rails ladies and we had fun making this simple app
2. Install Ruby and Rails
1. Go to http://railsinstaller.org/
2. Download the installer for your operating
system
3. Run the installer
Find where it is installed and verify that you can
run a console/shell window.
3. Create an app
The App we will make will be a list of resources
we can use to learn ruby.
rails new learning_tree
4. Create a scaffold
Scaffolding is used to make a controller, model and
view. Its basic but its a nice way to start an app.
cd learning_tree
rails g scaffold task
name:string url:string description:text
rails destroy scaffold task (will undo previous)
Use singular version!!
8. Try your app
Open your browser and go to http://localhost:
3000
Rails default port is 3000
9. Ready to customize
Lets change the task index to make the url a
link
<td><%= link_to(task.url, task.url) %></td>
link_to ( name of the link, url of link )
10. Move delete link to show
I dont like the delete link to be so easily edited,
so I move it to the show page.
<%= link_to 'Destroy', @task, method: :delete,
data: { confirm: 'Are you sure?' } %> |
change task to @task to use the instance
variable