-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSteps
87 lines (76 loc) · 2.52 KB
/
Steps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
1. Create a new rails app
2. Generate a controller via: rails generate controller navigator home dashboard ...
3. Generate title via: @page_name
4. Navigation bar via: link_to "home", {:controller => "navigator", :action => "home"}
5. Change home route via: root :controller => "navigator", :action => "home"
6. Create a database scaffold via: rails generate scaffold pages name:string title:string content:text
7. Create the database via: rake db:migrate
8. Create a seeker controller to view the stuff in the database via:
rails generate controller seeker show
9. In the show action, grab the queried page name via:
@page = Page.find_by_name(params[:name])
10. In the show view have this: <%= @page.content %>
11. Order this page in the url via: http://0.0.0.0:3000/navigator/show?name=Home
12. To make it possible to access pages directly add this to the route:
match ":name", :controller => "seeker", :action => "show"
13. Now go via the url: http://0.0.0.0:3000/Home
15. Update the link_to via:
<%= link_to "Home", {:controller => "navigator", :action => "show", :name => "Home"}%>
16. Change the title thing via: <title>CarefulApp -- <%= @page_title || @page.title %></title>
17. Add a filter in the pages controller so everything under it gets the same title:
before_filter :load_meta_data
def load_meta_data
@page_title = "Admin Page"
end
GIT
---
# Configure user name mine is Yusuf
git config --global user.name "Yusuf"
# Configure email mine is [email protected]
git config --global user.email [email protected]
# Initialize git
git init
# Add all files
git add .
# Check the status
git status
# Commit to a local directory
git commit -m "Initial commit"
# View a log of all commits so far
git log
# Checks out the latest version from repository. -f: forces overwrite
git checkout -f
# Set path to remote repo
git remote add origin [email protected]:yragab/carefulApp.git
# Push to the online repo
git push -u origin master
# Switch to a new branch
git checkout -b modify-README
# View branches
git branch
# Commit modifications to current branch
git commit -a -m "Improved the README file"
# Return to master branch
git checkout master
# Merge branch with master
git merge modify-README
# Delte a branch either when merged or when screwed up
git branch -d modify-README
# Now we can simply write
git push
Generate RSA public key:
ssh-keygen
To get the rsa public key:
pbcopy < ~/.ssh/id_rsa.pub
it is now on the clip blackboard
The .gitignore file.
.bundle
db/*.sqlite3*
log/*.log
*.log
/tmp/
doc/
*.swp
*~
.project
.DS_Store