Travelogue is community user driven blog website used to share tips, experience, and stories about their favorite locations around the world!
Sprint 1: Create a website with basic user sign up capabilities.
- Navigate to "/" and see a basic splash page with:
- The name of the website.
- Links to "Log In" and "Sign Up".
- Sign up for an account.
- Log in to their account if they already have one.
- Be redirected to their public profile page after logging in.
- On their public profile page, see their name, the current city they have set in their profile, and their join date.
- See the site-wide header on every page with:
- A link to "Log Out" if they're logged in.
- Links to "Log In" and "Sign Up" if they're logged out.
- Update their profile by making changes to their name and/or current city.
- See the titles of all the posts they've contributed (start with pre-seeded data).
- Click on the title of one of their posts and be redirected to a "show" page for that post.
- View post "show" pages with title, author, and content.
Sprint 2: Functionality with Cities and Posts
- View the "San Francisco" page (at "/cities/1") including:
- The site-wide header.
- The name of the city.
- An iconic photo of the city.
- View a list of posts on the San Francisco page:
- Sorted by newest first.
- With the post titles linked to the individual post "show" pages.
- Use an "Add New Post" button on the San Francisco city page to pull up the new post form.
- Create a new post for San Francisco (Hint: nested resources).
- Click "Edit" on ANY individual post, and be redirected to the edit form.
- Click "delete" on ANY individual post, then:
- See a pop-up that says: "Are you sure you want to delete #{title}?"
- If the user confirms, delete the post.
Sprint 3: Validations & Authorization
- View city pages for "London" and "Gibraltar".
- Verify that a new post they create is successfully published on the correct city page.
A user is authorized to perform certain actions on the site, according to the following rules:
- A user MUST be logged in to create/update/destroy resources.
- A user may only edit their own profile and edit/delete their own posts.
Alex
City Show Page
<% if current_user == article.user %>
<div class = "button">
<%= link_to "edit", edit_article_path(article.id), class: 'btn btn-light' %>
</div>
<div class = "button">
<%= button_to "remove", article_path(article) %>
</div></br>
<% end %>
Colbert
City Show Page
<%= button_to "remove", article_path(article), { method: :delete, data: {confirm: "Are you sure you want to delete '#{article.title}'?"}, class: 'btn btn-light'} %>
IS
Article Controller
def create
# @article = current_user.articles.new(article_params)
@article = Article.new(article_params)
current_user.articles << @article
# current_city.articles << @article
if @article.save
flash[:notice] = "Successfully created article."
redirect_to article_path(@article)
else
flash[:error] = @article.errors.full_messages.join(", ")
redirect_to new_article_path
end
end
Routes
get "/users/:last_name/articles/:id", to: "articles#show", as: "user_article"
get "/cities/:name/articles/:id", to: "articles#show", as: "city_article"
To Be Figured Out
get "/users/:last_name, to: "users#show", as: "user_name"
get "/users/:name, to: "cities#show", as: "city_name"
Doug
Git and Github Experience
On local master branch, DO NOT DO THIS
git pull origin feature_branch
Be Alert in Resolving Merge Conflicts
<<<<<<<<HEAD
========
.city_show_title:hover {
opacity: .99;
text-decoration: none;
>>>>>>>>>>
a:-webkit-any-link {
text-decoration: none;
}
#notice {
margin: 50px;
}
When merging multiple feature branches, merge each feature branch into the master individually.
- Ruby On Rails
- bcrypt
- ffaker
- Heroku
- Git + Github
- RESTful Routes
- HTML5
- CSS
- Fork and Clone Repo
bundle install
rake db:create
rake db:migrate
rake db:seed
rails s
- Go to localhost:3000 in Browser
This application is deployed on heroku here.
- Add More Cities
- Add Geotags
- Cannot sign up with an existing email address
- Post Title must be within 200 Characters