This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/rental_agreements" for 127.0.0.1 at 2012-12-20 19:16:33 -0500 | |
Processing by RentalAgreementsController#create as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"yfiXJUvhXm/8XsmLwNLOYOIVHulcZdQ7dadhvhvAHfo=", "rental_agreement"=>{"term_start"=>"12-10-2012", "term_end"=>"12-02-2013", "agreed_price"=>"2", "owner_id"=>"23", "tool_id"=>"1", "borrower_id"=>"23", "agreed_terms"=>"0"}, "commit"=>"Send Rental Proposal to Owner"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@rental_agreement = RentalAgreement.new(params[:rental_agreement]) | |
# UserMailer.rental_email(current_user, @rental_agreement.tool_id).deliver | |
respond_to do |format| | |
if @rental_agreement.save | |
format.html { redirect_to rental_agreement_path(id: @rental_agreement.id), notice: 'Rental agreement was successfully created.' } | |
format.json { render json: @rental_agreement, status: :created, location: @rental_agreement } | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= f.text_field :term_start, :type =>"text", :class =>"span2", :placeholder => "Pick the start date", :id =>"dp1" %> | |
<%= f.text_field :term_end, :class =>"span2", :placeholder => "Pick the return date", :id =>"dp2", :value=> "12-02-2013"%> | |
<script> | |
$('#dp1').datepicker({format: 'mm-dd-yyyy'}); | |
$('#dp2').datepicker({format: 'mm-dd-yyyy'}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @tools.each do |tool| %> | |
<tr> | |
<td><%= link_to tool.title, tool %></td> | |
<td><%= tool.price %></td> | |
<td><%= tool.address %></td> | |
<td><%= link_to tool.user.try(:email), profiles_path %></td> | |
<!-- <td><%= link_to 'Show', tool %></td> | |
<!-- <td><%= link_to 'Edit', edit_tool_path(tool) %></td> | |
<td><%= link_to 'Destroy', tool, method: :delete, data: { confirm: 'Are you sure?' } %></td> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profiles /profiles(.:format) profiles#show | |
GET /profiles(.:format) profiles#index | |
POST /profiles(.:format) profiles#create | |
new_profile GET /profiles/new(.:format) profiles#new | |
edit_profile GET /profiles/:id/edit(.:format) profiles#edit | |
profile GET /profiles/:id(.:format) profiles#show | |
PUT /profiles/:id(.:format) profiles#update | |
DELETE /profiles/:id(.:format) profiles#destroy | |
tools GET /tools(.:format) tools#index | |
POST /tools(.:format) tools#create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1 | |
Completed 500 Internal Server Error in 15ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Controller | |
class UsersController < ApplicationController | |
before_filter :authenticate_user! | |
def show | |
@user=User.find(params[:id]) | |
respond_to do |format| | |
format.html # show.html.erb | |
format.json { render json: @user } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root :to => "home#index" | |
match '/users', :to => "users#show" | |
devise_for :users | |
resources :users | |
resources :tools | |
get "pages/feedback" | |
get "/tools/index" => "tools#index", :as => "browse" | |
get "about" => "pages#about", :as => "about" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img alt="1logo" id="brand" src="/assets/logo_black_bg.png" style="{:height=>"22px", :width=>"44px"}"> |