Giter Club home page Giter Club logo

vagabond's Introduction

üTravel

Check out our app on Heroku

Objective

Our goal was to create a travel application built on relationships. The application allows users to sign up, login, and create posts that are attributed to different cities in the database. Each city has posts attributed to the cities. The posts describe different user experiences related to the city. The cities have a one to many relationship with posts and the users have a one to many relationship with posts. We wanted to create a splash/landing page that displayed the name of the website, with a call to action and the necessary log in/sign up buttons. We knew that user authorization and authentication was necessary to recognize existing users, prevent faulty users, and to prevent the general public from editing/deleting content. We also wanted to create administrative privileges so that we can ban an email or delete any user's content if it's offensive or abusive.

Technologies Used

-Ruby on Rails -Bootstrap -Puma(default server) The front end and back end is built on Ruby on Rails, with Puma running Ruby's default server. We used Bootstrap for the front end framework and so that we could work off a grid system. It also made the nav bar more aesthetically pleasing.

User Stories

You can learn more about our user stories on Trello. As a user, I want to be sign up. As a user, I want to log in/log out. As a user, I want to create posts that are attributed to cities. As a user, I want to edit, update, and delete my posts. As a user, I want to know that other users cannot edit/delete my information.

Wireframe

https://github.com/sf-wdi-31/project-vagabond/blob/master/wireframes.png

Control Flow

We made a new branch for each respective feature we built out. The idea of having a dev branch was difficult to stay in sync initially, but we ended up using scott-branch1 as our dev branch as a buffer between our feature branches and master. We had 35 branches total and over 100 commits. We had a few merge conflicts after the weekend that were tough to sort through but after that it was smooth sailing.

Code Snippets (Code We're Proud Of!)

<div class="holder">
<h2> <%= @city.try(:name) %></h2>
  <center><%= image_tag @city.image, height: 500, width: 800 %></center><br>
    <% if current_user && admin %>
    <%= button_to 'Delete City', destroy_city_path(@city), method: :delete, data: {confirm: "Are you sure you want to delete #{ @city.name }?"}, class: "btn btn-danger" %>
    <% end %>
</div>
Nick
def admin
  current_user && current_user.admin
end
Sherie
class User < ApplicationRecord
  has_secure_password
  has_many :posts, dependent: :destroy
  def self.confirm(params)
    @user = User.find_by({email: params[:email]})
    @user ? @user.authenticate(params[:password]) : false
  end
  validates :email, uniqueness:true
  Scott
Scott Whitman [12:21 PM]  
<% @city.posts.sort_by{|post| [post['updated_at']]}.reverse.each do |post| %>
 <h3> <%= link_to post.title, city_post_path(@city, post) %></h3>
 <h5> <strong>Posted by:</strong> <%= link_to User.find_by_id(post.user_id).name, user_path(post.user_id) %> </h5>
 <h5> <strong>Created:</strong> <%= post.created_at.localtime.to_formatted_s(:long_ordinal) %> </h5>
 <h5> <%= "Edited on " + post.updated_at.localtime.to_formatted_s(:long_ordinal) if post.updated_at.to_s != post.created_at.to_s %> </h5>
 <h4> <em><%= post.body.length > 180 ? post.body[0,180] << "..." : post.body %></em> </h4>
 <% end %>
end

vagabond's People

Contributors

14budig avatar scottwwhitman avatar sheriecarter avatar acordivari avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.