diff --git a/:show b/:show new file mode 100644 index 0000000..e69de29 diff --git a/Gemfile b/Gemfile index ec2ba7b..2ab0ce2 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'devise' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' + gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' # See https://github.com/sstephenson/execjs#readme for more supported runtimes @@ -47,5 +47,7 @@ gem 'paperclip' # To use debugger # gem 'ruby-debug19', :require => 'ruby-debug' -gem 'json', '1.6.5' +gem 'execjs' +gem 'therubyracer' +gem 'json', '1.6.5' diff --git a/Gemfile.lock b/Gemfile.lock index fd905dc..8ea5e21 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,7 +39,7 @@ GEM coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.3.1) + coffee-script-source (1.2.0) devise (2.0.4) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) @@ -51,21 +51,21 @@ GEM hike (1.2.1) i18n (0.6.0) journey (1.0.3) - jquery-rails (2.0.2) + jquery-rails (2.0.1) railties (>= 3.2.0, < 5.0) thor (~> 0.14) json (1.6.5) + libv8 (3.3.10.4) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.18) - multi_json (1.3.1) + mime-types (1.17.2) + multi_json (1.1.0) orm_adapter (0.0.7) - paperclip (3.0.2) - activemodel (>= 3.0.0) - activerecord (>= 3.0.0) - activesupport (>= 3.0.0) + paperclip (2.4.5) + activerecord (>= 2.3.0) + activesupport (>= 2.3.2) cocaine (>= 0.0.2) mime-types pg (0.13.2) @@ -96,7 +96,7 @@ GEM rdoc (3.12) json (~> 1.4) sass (3.1.15) - sass-rails (3.2.5) + sass-rails (3.2.4) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) @@ -104,14 +104,16 @@ GEM hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.5) + sqlite3 (1.3.6) + therubyracer (0.10.1) + libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.33) - uglifier (1.2.4) + tzinfo (0.3.32) + uglifier (1.2.3) execjs (>= 0.3.0) multi_json (>= 1.0.2) warden (1.1.1) @@ -124,6 +126,7 @@ DEPENDENCIES cleditor_rails coffee-rails (~> 3.2.1) devise + execjs jquery-rails json (= 1.6.5) paperclip @@ -131,4 +134,5 @@ DEPENDENCIES rails (= 3.2.2) sass-rails (~> 3.2.3) sqlite3 + therubyracer uglifier (>= 1.0.3) diff --git a/Gemfile.lock~ b/Gemfile.lock~ new file mode 100644 index 0000000..454ca9b --- /dev/null +++ b/Gemfile.lock~ @@ -0,0 +1,138 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (3.2.2) + actionpack (= 3.2.2) + mail (~> 2.4.0) + actionpack (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.1) + rack (~> 1.4.0) + rack-cache (~> 1.1) + rack-test (~> 0.6.1) + sprockets (~> 2.1.2) + activemodel (3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + activerecord (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + activesupport (3.2.2) + i18n (~> 0.6) + multi_json (~> 1.0) + arel (3.0.2) + bcrypt-ruby (3.0.1) + builder (3.0.0) + cleditor_rails (0.0.3) +<<<<<<< HEAD +======= + cocaine (0.2.1) +>>>>>>> planet2012/master + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.2.0) + devise (2.0.4) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.0.3) + railties (~> 3.1) + warden (~> 1.1.1) + erubis (2.7.0) + execjs (1.3.0) + multi_json (~> 1.0) + hike (1.2.1) + i18n (0.6.0) + journey (1.0.3) + jquery-rails (2.0.1) + railties (>= 3.2.0, < 5.0) + thor (~> 0.14) + json (1.6.5) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.17.2) + multi_json (1.1.0) + orm_adapter (0.0.7) +<<<<<<< HEAD +======= + paperclip (2.4.5) + activerecord (>= 2.3.0) + activesupport (>= 2.3.2) + cocaine (>= 0.0.2) + mime-types + pg (0.13.2) +>>>>>>> planet2012/master + polyglot (0.3.3) + rack (1.4.1) + rack-cache (1.2) + rack (>= 0.4) + rack-ssl (1.3.2) + rack + rack-test (0.6.1) + rack (>= 1.0) + rails (3.2.2) + actionmailer (= 3.2.2) + actionpack (= 3.2.2) + activerecord (= 3.2.2) + activeresource (= 3.2.2) + activesupport (= 3.2.2) + bundler (~> 1.0) + railties (= 3.2.2) + railties (3.2.2) + actionpack (= 3.2.2) + activesupport (= 3.2.2) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + sass (3.1.15) + sass-rails (3.2.4) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.1.2) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.5) + thor (0.14.6) + tilt (1.3.3) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.32) + uglifier (1.2.3) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) + warden (1.1.1) + rack (>= 1.0) + +PLATFORMS + ruby + +DEPENDENCIES + cleditor_rails + coffee-rails (~> 3.2.1) + devise + jquery-rails + paperclip + pg + rails (= 3.2.2) + sass-rails (~> 3.2.3) + sqlite3 + uglifier (>= 1.0.3) diff --git a/Gemfile~ b/Gemfile~ new file mode 100644 index 0000000..dabdd2f --- /dev/null +++ b/Gemfile~ @@ -0,0 +1,42 @@ +source 'https://rubygems.org' + +gem 'rails', '3.2.2' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +gem 'devise' + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + # gem 'therubyracer' + + gem 'uglifier', '>= 1.0.3' +end + +gem 'jquery-rails' +gem 'cleditor_rails' + +gem 'paperclip' + +gem 'pg' + +# To use ActiveModel has_secure_password +# gem 'bcrypt-ruby', '~> 3.0.0' + +# To use Jbuilder templates for JSON +# gem 'jbuilder' + +# Use unicorn as the app server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# To use debugger +# gem 'ruby-debug19', :require => 'ruby-debug' diff --git a/Rakefile~ b/Rakefile~ new file mode 100644 index 0000000..8d9611e --- /dev/null +++ b/Rakefile~ @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Planet::Application.load_tasks diff --git a/app/assets/images/Daniel.jpg b/app/assets/images/Daniel.jpg new file mode 100644 index 0000000..ce0bc60 Binary files /dev/null and b/app/assets/images/Daniel.jpg differ diff --git a/app/assets/images/marina.JPG b/app/assets/images/marina.JPG new file mode 100644 index 0000000..f30dee3 Binary files /dev/null and b/app/assets/images/marina.JPG differ diff --git a/app/assets/images/teide.jpg b/app/assets/images/teide.jpg new file mode 100644 index 0000000..ca7aa9f Binary files /dev/null and b/app/assets/images/teide.jpg differ diff --git a/app/assets/images/vilaflor.jpg b/app/assets/images/vilaflor.jpg new file mode 100644 index 0000000..83b2579 Binary files /dev/null and b/app/assets/images/vilaflor.jpg differ diff --git a/app/assets/javascripts/application.js~ b/app/assets/javascripts/application.js~ new file mode 100644 index 0000000..9097d83 --- /dev/null +++ b/app/assets/javascripts/application.js~ @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/comments.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/application.css~ b/app/assets/stylesheets/application.css~ new file mode 100644 index 0000000..3b5cc66 --- /dev/null +++ b/app/assets/stylesheets/application.css~ @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . +*/ diff --git a/app/assets/stylesheets/comments.css.scss b/app/assets/stylesheets/comments.css.scss new file mode 100644 index 0000000..3722c12 --- /dev/null +++ b/app/assets/stylesheets/comments.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the comments controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/planet.css b/app/assets/stylesheets/planet.css index ead053a..84c3d81 100644 --- a/app/assets/stylesheets/planet.css +++ b/app/assets/stylesheets/planet.css @@ -11,7 +11,7 @@ #planet h1 { - font: 150% sans-serif; + font: 150% sans-serif; color: #226; border-bottom: 3px dotted #77d; } @@ -28,12 +28,12 @@ } #site_list .list_image { - width: 60px; - height: 70px; + width: 60px; + height: 70px; } #site_list .list_description { - width: 60%; + width: 60%; } #site_list .list_description dl { @@ -41,9 +41,9 @@ } #site_list .list_description dt { - color: #244; - font-weight: bold; - font-size: larger; +color: #244; +font-weight: bold; +font-size: larger; } #site_list .list_description dd { @@ -51,17 +51,49 @@ } #site_list .list_actions { - font-size: x-small; - text-align: right; + font-size: x-small; + text-align: right; padding-left: 1em; } #site_list .list_line_even { - background: #a8b8f8; + background: #a8b8f8; } #site_list .list_line_odd { - background: #88b0f8; + background: #88b0f8; +} + +/* Styles for comments */ + +#comment_list table tr td { + padding: 5px; + vertical-align: top; +} + + +#comment_list .comment_description { + width: 60%; +} + +#comment_list .comment_description dl { + margin: 0; +} + +#comment_list .comment_description dt { +color: #244; +font-weight: bold; +font-size: small; +} + +#comment_list .comment_description dd { + margin: 0; +} + +#comment_list .comment_actions { + font-size: x-small; + text-align: right; + padding-left: 1em; } @@ -72,7 +104,7 @@ background: #668; padding-top: 10px; padding-bottom: 10px; - border-bottom: 2px solid; + border-bottom: 2px solid; font: small-caps 40px/40px "Times New Roman", serif; color: #bfb; text-align: center; @@ -89,12 +121,17 @@ font-size: small; } +#search { + float: right; /* Ajuste de borde izquierdo */ + color: #bfb; +} + #columns { background: #446; } #main { - margin-left: 9em; /* Ajuste de borde izquierdo */ + margin-left: 9em; /* Ajuste de borde izquierdo */ padding-top: 4ex; padding-left: 2em; background: white; @@ -105,7 +142,7 @@ padding-top: 1em; padding-left: 1em; padding-bottom: 1em; - width: 8em; /* Ajuste de borde izquierdo */ + width: 8em; /* Ajuste de borde izquierdo */ background: #446; } @@ -117,13 +154,13 @@ /* An entry in the store catalog (no utilizados de momento) */ -#planet .entry { +#planet .entry { overflow: auto; margin-top: 1em; border-bottom: 1px dotted #77d; } -#planet .name { +#planet .name { font-size: 120%; font-family: sans-serif; } @@ -143,8 +180,8 @@ } #store .entry p { - margin-top: 0.5em; - margin-bottom: 0.8em; + margin-top: 0.5em; + margin-bottom: 0.8em; } #store .entry .price_line { @@ -156,14 +193,18 @@ position: relative; } -#store .entry .price { +#store .entry .price { color: #44a; font-weight: bold; margin-right: 2em; } - #main .visitas { - text-indent: 70%; + text-indent: 50%; +} + +#main .geo{ + height: 500px; + width :500px; } diff --git a/app/assets/stylesheets/planet.css~ b/app/assets/stylesheets/planet.css~ new file mode 100644 index 0000000..ea64653 --- /dev/null +++ b/app/assets/stylesheets/planet.css~ @@ -0,0 +1,210 @@ +/* Global styles (no utilizados de momento) */ + +#planet #notice { + color: #000; + border: 2px solid red; + padding: 1em; + margin-bottom: 2em; + background-color: #f0f0f0; + font: bold smaller sans-serif; +} + + +#planet h1 { + font: 150% sans-serif; + color: #226; + border-bottom: 3px dotted #77d; +} + +/* Styles for products/index */ + +#site_list table { + border-collapse: collapse; +} + +#site_list table tr td { + padding: 5px; + vertical-align: top; +} + +#site_list .list_image { + width: 60px; + height: 70px; +} + +#site_list .list_description { + width: 60%; +} + +#site_list .list_description dl { + margin: 0; +} + +#site_list .list_description dt { +color: #244; +font-weight: bold; +font-size: larger; +} + +#site_list .list_description dd { + margin: 0; +} + +#site_list .list_actions { + font-size: x-small; + text-align: right; + padding-left: 1em; +} + +#site_list .list_line_even { + background: #a8b8f8; +} + +#site_list .list_line_odd { + background: #88b0f8; +} + +/* Styles for comments */ + +#comment_list table tr td { + padding: 5px; + vertical-align: top; +} + + +#comment_list .comment_description { + width: 60%; +} + +#comment_list .comment_description dl { + margin: 0; +} + +#comment_list .comment_description dt { +color: #244; +font-weight: bold; +font-size: small; +} + +#comment_list .comment_description dd { + margin: 0; +} + +#comment_list .comment_actions { + font-size: x-small; + text-align: right; + padding-left: 1em; +} + + +/* START:mainlayout */ +/* Styles for main page */ + +#banner { + background: #668; + padding-top: 10px; + padding-bottom: 10px; + border-bottom: 2px solid; + font: small-caps 40px/40px "Times New Roman", serif; + color: #bfb; + text-align: center; +} + +#banner img { + float: left; + padding-left: 10px; +} + +#banner .user { + float: right; + color: #bfb; + font-size: small; +} + +#search { + float: left; /* Ajuste de borde izquierdo */ + color: #bfb; +} + +#columns { + background: #446; +} + +#main { + margin-left: 9em; /* Ajuste de borde izquierdo */ + padding-top: 4ex; + padding-left: 2em; + background: white; +} + +#side { + float: left; + padding-top: 1em; + padding-left: 1em; + padding-bottom: 1em; + width: 8em; /* Ajuste de borde izquierdo */ + background: #446; +} + +#side a { + color: #bfb; + font-size: small; +} +/* END:mainlayout */ + +/* An entry in the store catalog (no utilizados de momento) */ + +#planet .entry { + overflow: auto; + margin-top: 1em; + border-bottom: 1px dotted #77d; +} + +#planet .name { + font-size: 120%; + font-family: sans-serif; +} + +#store .entry img { + width: 80px; + margin-right: 5px; + margin-bottom: 5px; + float: left; +} + + +#store .entry h3 { + margin-top: 0; + margin-bottom: 2px; + color: #227; +} + +#store .entry p { + margin-top: 0.5em; + margin-bottom: 0.8em; +} + +#store .entry .price_line { + clear: both; + margin-bottom: 0.5em; +} + +#store .entry .add_to_cart { + position: relative; +} + +#store .entry .price { + color: #44a; + font-weight: bold; + margin-right: 2em; +} + +#main .visitas { + text-indent: 50%; +} + +#main .geo{ + height: 500px; + width :500px; +} + diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 0000000..92ee2c4 --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,92 @@ +class CommentsController < ApplicationController + + # GET /comments + # GET /comments.json + def index + if params[:site_id].nil? or params[:site_id].empty? + @comments = Comment.all + else + @comments = Site.find(params[:site_id]).comments # path: /sites/id/comment + end + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @coments } + end + end + + # GET /comments/1 + # GET /comments/1.json + def show + @comment = Comment.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/new + # GET /comments/new.json + def new + @comment = Comment.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @comment } + end + end + + def edit + @site = Site.find(params[:site_id]) + @comment = @site.comments.find(params[:id]) + end + + # POST /comments + # POST /comments.json + def create + @site = Site.find(params[:site_id]) + @comment = @site.comments.create(params[:comment]) + @comment.user_id = current_user.id + + respond_to do |format| + if @comment.save + format.html { redirect_to @site, notice: 'Comentario creado' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comments/1 + # PUT /comments/1.json + def update +@site = Site.find(params[:site_id]) +@comment = @site.comments.find(params[:id]) + +respond_to do |format| +if @comment.update_attributes(params[:comment]) +format.html { redirect_to @site, notice: 'Comentario actualizado' } +format.json { head :no_content } +else +format.html { render action: "edit" } +format.json { render json: @comment.errors, status: :unprocessable_entity } +end +end +end + + # DELETE /comments/1 + # DELETE /comments/1.json + def destroy + @site = Site.find(params[:site_id]) + @coment = @site.comments.find(params[:id]) + @coment.destroy + + respond_to do |format| + format.html { redirect_to site_path(@site) } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/comments_controller.rb~ b/app/controllers/comments_controller.rb~ new file mode 100644 index 0000000..92ee2c4 --- /dev/null +++ b/app/controllers/comments_controller.rb~ @@ -0,0 +1,92 @@ +class CommentsController < ApplicationController + + # GET /comments + # GET /comments.json + def index + if params[:site_id].nil? or params[:site_id].empty? + @comments = Comment.all + else + @comments = Site.find(params[:site_id]).comments # path: /sites/id/comment + end + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @coments } + end + end + + # GET /comments/1 + # GET /comments/1.json + def show + @comment = Comment.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/new + # GET /comments/new.json + def new + @comment = Comment.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @comment } + end + end + + def edit + @site = Site.find(params[:site_id]) + @comment = @site.comments.find(params[:id]) + end + + # POST /comments + # POST /comments.json + def create + @site = Site.find(params[:site_id]) + @comment = @site.comments.create(params[:comment]) + @comment.user_id = current_user.id + + respond_to do |format| + if @comment.save + format.html { redirect_to @site, notice: 'Comentario creado' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comments/1 + # PUT /comments/1.json + def update +@site = Site.find(params[:site_id]) +@comment = @site.comments.find(params[:id]) + +respond_to do |format| +if @comment.update_attributes(params[:comment]) +format.html { redirect_to @site, notice: 'Comentario actualizado' } +format.json { head :no_content } +else +format.html { render action: "edit" } +format.json { render json: @comment.errors, status: :unprocessable_entity } +end +end +end + + # DELETE /comments/1 + # DELETE /comments/1.json + def destroy + @site = Site.find(params[:site_id]) + @coment = @site.comments.find(params[:id]) + @coment.destroy + + respond_to do |format| + format.html { redirect_to site_path(@site) } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index a8636bd..0531b02 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -29,5 +29,14 @@ def contact # Método que define una acción vacía del controlador def ejemplo end + + def search + if params[:busqueda].length >= 3 + @sites = Site.where("name like ? OR description like ?", "%#{params[:busqueda]}%", "%#{params[:busqueda]}%") + @trips = Trip.where("name like ? OR description like ?", "%#{params[:busqueda]}%", "%#{params[:busqueda]}%") + else + render action: "errorSearch" + end + end end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ new file mode 100644 index 0000000..40a4728 --- /dev/null +++ b/app/controllers/planet_controller.rb~ @@ -0,0 +1,42 @@ +# PlanetController ilustra el uso de *RDoc*. La documentación de un proyecto en +# genera en el directorio *proy/doc* en formato Web con +# $proy> rake doc:app +# +# == Algunos comandos de formateo +# +# Tal y como muestra el subitulo anterior, este se define empezando la +# línea con ==. En los títulos debe empezar por =. +# +# Un [ ... ] seguido de texto define una lista titulada, como aquí +# [Clases, Módulos o Métodos] Se documentan con comentarios justo encima de sus definición, como aquí. +# +# Un * o - definen las entradas de una lista itemizada +# * Un URL se define así email[mailto:pepe@ejemplo.com] +# * o así {Pepe Rubio}[mailto:pepe@ejemplo.com] +# +# Un número o letra seguido de punto genera una lista númerada +# 1. + permite generar *negrita*, igual que con HTML +# 2. _ permite generar _cursiva_, igual que con HTML +# 3. * permite generar letra de +teletipo+, igual que con HTML +# +class PlanetController < ApplicationController + # Método que define una acción vacía del controlador + def index + end + # Método que define una acción vacía del controlador + def contact + end + # Método que define una acción vacía del controlador + def ejemplo + end + + def search + if params[:busqueda].length >= 3 + @sites = Site.where("name like ? OR description like ?", "%#{params[:q]}%", "%#{params[:q]}%") + @trips = Trip.where("name like ? OR description like ?", "%#{params[:q]}%", "%#{params[:q]}%") + else + render action: "errorSearch" + end + end + +end diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 57e0611..e3fe402 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -1,16 +1,14 @@ class SitesController < ApplicationController - # authenticate_user! ejecuta acción solo si sesión existe before_filter :authenticate_user!, :except => [ :index, :show ] - after_filter :count_visita, :only => :show - + # GET /sites # GET /sites.json - def index + def index if params[:type_id].nil? or params[:type_id].empty? - @sites = Site.all # path: /types + @sites = Site.all # path: /types else - @sites = Type.find(params[:type_id]).sites # path: /types/id/sites + @sites = Type.find(params[:type_id]).sites # path: /types/id/sites end respond_to do |format| format.html # index.html.erb @@ -22,7 +20,7 @@ def index # GET /sites/1.json def show @site = Site.find(params[:id]) - + @site.increment!(:visitas) respond_to do |format| format.html # show.html.erb format.json { render json: @site } @@ -33,7 +31,7 @@ def show # GET /sites/new.json def new @site = current_user.sites.build # crea sitio vacio asociado a current_user - + respond_to do |format| format.html # new.html.erb format.json { render json: @site } @@ -49,7 +47,7 @@ def edit # POST /sites.json def create @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user - + respond_to do |format| if @site.save format.html { redirect_to @site, notice: 'Site was successfully created.' } @@ -65,7 +63,7 @@ def create # PUT /sites/1.json def update @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user - + respond_to do |format| if @site.update_attributes(params[:site]) format.html { redirect_to @site, notice: 'Site was successfully updated.' } @@ -88,9 +86,4 @@ def destroy format.json { head :no_content } end end - - private - def count_visita - @site.increment!(:visitas) - end end diff --git a/app/controllers/sites_controller.rb~ b/app/controllers/sites_controller.rb~ new file mode 100644 index 0000000..497edcd --- /dev/null +++ b/app/controllers/sites_controller.rb~ @@ -0,0 +1,89 @@ +class SitesController < ApplicationController + # authenticate_user! ejecuta acción solo si sesión existe + before_filter :authenticate_user!, :except => [ :index, :show ] + + # GET /sites + # GET /sites.json + def index + if params[:type_id].nil? or params[:type_id].empty? + @sites = Site.all # path: /types + else + @sites = Type.find(params[:type_id]).sites # path: /types/id/sites + end + respond_to do |format| + format.html # index.html.erb + format.json { render json: @sites } + end + end + + # GET /sites/1 + # GET /sites/1.json + def show + @site = Site.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @site } + end + end + + # GET /sites/new + # GET /sites/new.json + def new + @site = current_user.sites.build # crea sitio vacio asociado a current_user + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @site } + end + end + + # GET /sites/1/edit + def edit + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + end + + # POST /sites + # POST /sites.json + def create + @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user + + respond_to do |format| + if @site.save + format.html { redirect_to @site, notice: 'Site was successfully created.' } + format.json { render json: @site, status: :created, location: @site } + else + format.html { render action: "new" } + format.json { render json: @site.errors, status: :unprocessable_entity } + end + end + end + + # PUT /sites/1 + # PUT /sites/1.json + def update + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + + respond_to do |format| + if @site.update_attributes(params[:site]) + format.html { redirect_to @site, notice: 'Site was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @site.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /sites/1 + # DELETE /sites/1.json + def destroy + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + @site.destroy + + respond_to do |format| + format.html { redirect_to sites_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/trips_controller.rb b/app/controllers/trips_controller.rb index 321f6e3..b8b9ab7 100644 --- a/app/controllers/trips_controller.rb +++ b/app/controllers/trips_controller.rb @@ -19,7 +19,6 @@ def index def show @trip = Trip.find(params[:id]) @visit = @trip.visits.build - respond_to do |format| format.html # show.html.erb format.json { render json: @trip } diff --git a/app/controllers/trips_controller.rb~ b/app/controllers/trips_controller.rb~ new file mode 100644 index 0000000..d59d03a --- /dev/null +++ b/app/controllers/trips_controller.rb~ @@ -0,0 +1,91 @@ +class TripsController < ApplicationController + + # authenticate_user! ejecuta acción solo si sesión existe + before_filter :authenticate_user!, :except => [ :index, :show ] + + # GET /trips + # GET /trips.json + def index + @trips = Trip.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @trips } + end + end + + # GET /trips/1 + # GET /trips/1.json + def show + @trip = Trip.find(params[:id]) +<<<<<<< HEAD +======= + @visit = @trip.visits.build +>>>>>>> planet2012/master + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @trip } + end + end + + # GET /trips/new + # GET /trips/new.json + def new + @trip = current_user.trips.build + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @trip } + end + end + + # GET /trips/1/edit + def edit + @trip = current_user.trips.find(params[:id]) + end + + # POST /trips + # POST /trips.json + def create + @trip = current_user.trips.build(params[:trip]) + + respond_to do |format| + if @trip.save + format.html { redirect_to @trip, notice: 'Trip was successfully created.' } + format.json { render json: @trip, status: :created, location: @trip } + else + format.html { render action: "new" } + format.json { render json: @trip.errors, status: :unprocessable_entity } + end + end + end + + # PUT /trips/1 + # PUT /trips/1.json + def update + @trip = current_user.trips.find(params[:id]) + + respond_to do |format| + if @trip.update_attributes(params[:trip]) + format.html { redirect_to @trip, notice: 'Trip was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @trip.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /trips/1 + # DELETE /trips/1.json + def destroy + @trip = current_user.trips.find(params[:id]) + @trip.destroy + + respond_to do |format| + format.html { redirect_to trips_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..8062c71 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -80,4 +80,18 @@ def destroy format.json { head :no_content } end end + + def ordered_index + end + + # GET /types/ordered_index + # GET /types/ordered_index.json + def ordered_index + @types = Type.find(:all, :order => :name) + + respond_to do |format| + format.html # ordered_index.html.erb + format.json { render json: @types } + end + end end diff --git a/app/controllers/types_controller.rb~ b/app/controllers/types_controller.rb~ new file mode 100644 index 0000000..8062c71 --- /dev/null +++ b/app/controllers/types_controller.rb~ @@ -0,0 +1,97 @@ +class TypesController < ApplicationController + # GET /types + # GET /types.json + def index + @types = Type.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @types } + end + end + + # GET /types/1 + # GET /types/1.json + def show + @type = Type.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @type } + end + end + + # GET /types/new + # GET /types/new.json + def new + @type = Type.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @type } + end + end + + # GET /types/1/edit + def edit + @type = Type.find(params[:id]) + end + + # POST /types + # POST /types.json + def create + @type = Type.new(params[:type]) + + respond_to do |format| + if @type.save + format.html { redirect_to @type, notice: 'Type was successfully created.' } + format.json { render json: @type, status: :created, location: @type } + else + format.html { render action: "new" } + format.json { render json: @type.errors, status: :unprocessable_entity } + end + end + end + + # PUT /types/1 + # PUT /types/1.json + def update + @type = Type.find(params[:id]) + + respond_to do |format| + if @type.update_attributes(params[:type]) + format.html { redirect_to @type, notice: 'Type was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @type.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /types/1 + # DELETE /types/1.json + def destroy + @type = Type.find(params[:id]) + @type.destroy + + respond_to do |format| + format.html { redirect_to types_url } + format.json { head :no_content } + end + end + + def ordered_index + end + + # GET /types/ordered_index + # GET /types/ordered_index.json + def ordered_index + @types = Type.find(:all, :order => :name) + + respond_to do |format| + format.html # ordered_index.html.erb + format.json { render json: @types } + end + end +end diff --git a/app/controllers/visits_controller.rb~ b/app/controllers/visits_controller.rb~ new file mode 100644 index 0000000..5bd5366 --- /dev/null +++ b/app/controllers/visits_controller.rb~ @@ -0,0 +1,84 @@ +class VisitsController < ApplicationController + # GET /visits + # GET /visits.json + def index + @visits = Visit.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @visits } + end + end + + # GET /visits/1 + # GET /visits/1.json + def show + @visit = Visit.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @visit } + end + end + + # GET /visits/new + # GET /visits/new.json + def new + @visit = Visit.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @visit } + end + end + + # GET /visits/1/edit + def edit + @visit = Visit.find(params[:id]) + end + + # POST /visits + # POST /visits.json + def create + @visit = Visit.new(params[:visit]) + + respond_to do |format| + if @visit.save + format.html { redirect_to @visit.trip, notice: 'Visit was successfully created.' } + format.js + format.json { render json: @visit, status: :created, location: @visit } + else + format.html { render action: "new" } + format.json { render json: @visit.errors, status: :unprocessable_entity } + end + end + end + + # PUT /visits/1 + # PUT /visits/1.json + def update + @visit = Visit.find(params[:id]) + + respond_to do |format| + if @visit.update_attributes(params[:visit]) + format.html { redirect_to @visit.trip, notice: 'Visit was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @visit.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /visits/1 + # DELETE /visits/1.json + def destroy + @visit = Visit.find(params[:id]) + @visit.destroy + + respond_to do |format| + format.html { redirect_to @visit.trip } + format.json { head :no_content } + end + end +end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 0000000..0ec9ca5 --- /dev/null +++ b/app/helpers/comments_helper.rb @@ -0,0 +1,2 @@ +module CommentsHelper +end diff --git a/app/models/comment.rb b/app/models/comment.rb new file mode 100644 index 0000000..ece23d0 --- /dev/null +++ b/app/models/comment.rb @@ -0,0 +1,6 @@ +class Comment < ActiveRecord::Base + belongs_to :user + belongs_to :site + + attr_protected :user_id +end diff --git a/app/models/comment.rb~ b/app/models/comment.rb~ new file mode 100644 index 0000000..e16f5ae --- /dev/null +++ b/app/models/comment.rb~ @@ -0,0 +1,7 @@ +class Comment < ActiveRecord::Base + + belongs_to :user + belongs_to :site + + attr_protected :user_id +end diff --git a/app/models/site.rb b/app/models/site.rb index 2b2f99a..a7ba8b9 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -1,6 +1,7 @@ class Site < ActiveRecord::Base belongs_to :type belongs_to :user + has_many :comments has_many :visits has_many :trips, :through => :visits has_attached_file :image @@ -11,4 +12,6 @@ class Site < ActiveRecord::Base # Se añaden estas definiciones validates :name, :type_id, :presence => true # campo obligatorio + end + diff --git a/app/models/site.rb~ b/app/models/site.rb~ new file mode 100644 index 0000000..1ff5bcf --- /dev/null +++ b/app/models/site.rb~ @@ -0,0 +1,18 @@ +class Site < ActiveRecord::Base + belongs_to :type + belongs_to :user + has_many :comments + has_many :visits + has_many :trips, :through => :visits + has_attached_file :image + + + # Debe estar protegido para evitar accesos indeseados + attr_protected :user_id + + # Se añaden estas definiciones + validates :name, :type_id, :presence => true # campo obligatorio + +end +end + diff --git a/app/models/trip.rb~ b/app/models/trip.rb~ new file mode 100644 index 0000000..df44742 --- /dev/null +++ b/app/models/trip.rb~ @@ -0,0 +1,13 @@ +class Trip < ActiveRecord::Base +<<<<<<< HEAD + belongs_to :user + + attr_protected :user_id +======= + belongs_to :user + has_many :visits + has_many :sites, :through => :visits + + attr_protected :user_id # por seguridad +>>>>>>> planet2012/master +end diff --git a/app/models/type.rb~ b/app/models/type.rb~ new file mode 100644 index 0000000..d966722 --- /dev/null +++ b/app/models/type.rb~ @@ -0,0 +1,15 @@ +class Type < ActiveRecord::Base +<<<<<<< HEAD + has_many :sites + # Se añade esta definición de recurso + validates :name, :description, :presence => true # campo obligatorio + validates :name, :uniqueness => true # Campo no repetido +======= + has_many :sites + + + # Se añade esta definición de recurso + validates :name, :description, :presence => true # campo obligatorio + validates :name, :uniqueness => true # Campo único (no repetido) +>>>>>>> planet2012/master +end diff --git a/app/models/user.rb b/app/models/user.rb index 35b8159..8383919 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,8 @@ class User < ActiveRecord::Base - has_many :sites has_many :trips - + has_many :comments + # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, diff --git a/app/models/user.rb~ b/app/models/user.rb~ new file mode 100644 index 0000000..75ff714 --- /dev/null +++ b/app/models/user.rb~ @@ -0,0 +1,14 @@ +class User < ActiveRecord::Base + has_many :sites + has_many :trips + + # Include default devise modules. Others available are: + # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :trackable, :validatable + + validates_presence_of :name + + # Setup accessible (or protected) attributes for your model + attr_accessible :name, :email, :password, :password_confirmation, :remember_me +end diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb new file mode 100644 index 0000000..db20f75 --- /dev/null +++ b/app/views/comments/_comment.html.erb @@ -0,0 +1,22 @@ +
+ + + + + + + <% end %> +
+
+
<%= comment.user.name %>
+

<%= truncate(strip_tags(comment.coment), + :length => 240) %>
+
+
+ <% if comment.user == current_user %> + <%= link_to 'Edit', edit_site_comment_path(comment.site, comment) %>
+ <%= link_to 'Destroy', [comment.site, comment], + :confirm => 'Are you sure?', + :method => :delete %> +
+
diff --git a/app/views/comments/_comment.html.erb~ b/app/views/comments/_comment.html.erb~ new file mode 100644 index 0000000..5e8d1bc --- /dev/null +++ b/app/views/comments/_comment.html.erb~ @@ -0,0 +1,22 @@ +
+ + + + + + + <% end %> +
+
+
<%= comment.user.name %>
+

<%= truncate(strip_tags(comment.coment), + :length => 240) %>
+
+
+ <% if comment.user == current_user %> + <%= link_to 'Edit', edit_site_comment_path(comment.site, comment) %>
+ <%= link_to 'Destroy', [comment.site, comment], + :confirm => 'Are you sure?', + :method => :delete %> +
+
diff --git a/app/views/comments/_edit.html.erb~ b/app/views/comments/_edit.html.erb~ new file mode 100644 index 0000000..e69de29 diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb new file mode 100644 index 0000000..466fb0f --- /dev/null +++ b/app/views/comments/_form.html.erb @@ -0,0 +1,10 @@ +<%= form_for([@site, @site.comments.build]) do |f| %> +
+ <%= f.text_area :coment %> +
+ +
+ <%= f.submit %> +
+<% end %> + diff --git a/app/views/comments/_form.html.erb~ b/app/views/comments/_form.html.erb~ new file mode 100644 index 0000000..212ce02 --- /dev/null +++ b/app/views/comments/_form.html.erb~ @@ -0,0 +1,11 @@ + +<%= form_for([@site, @site.comments.build]) do |f| %> +
+ <%= f.text_area :coment %> +
+ +
+ <%= f.submit %> +
+<% end %> + diff --git a/app/views/comments/edit.html.erb b/app/views/comments/edit.html.erb new file mode 100644 index 0000000..4bd3741 --- /dev/null +++ b/app/views/comments/edit.html.erb @@ -0,0 +1,24 @@ +

Editar comentario

+ +<%= form_for([@site, @comment]) do |comment| %> + <% if @comment.errors.any? %> +
+

<%= pluralize(@comment.errors.count, "error") %> prohibited this site from being saved:

+ + +
+ <% end %> + +
+ <%= comment.text_area :coment %> +
+ +
+ <%= comment.submit %> +
+<% end %> + diff --git a/app/views/comments/edit.html.erb~ b/app/views/comments/edit.html.erb~ new file mode 100644 index 0000000..4bd3741 --- /dev/null +++ b/app/views/comments/edit.html.erb~ @@ -0,0 +1,24 @@ +

Editar comentario

+ +<%= form_for([@site, @comment]) do |comment| %> + <% if @comment.errors.any? %> +
+

<%= pluralize(@comment.errors.count, "error") %> prohibited this site from being saved:

+ + +
+ <% end %> + +
+ <%= comment.text_area :coment %> +
+ +
+ <%= comment.submit %> +
+<% end %> + diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb new file mode 100644 index 0000000..5687809 --- /dev/null +++ b/app/views/comments/index.html.erb @@ -0,0 +1,22 @@ +
+

Comentarios del sitio

+ + + <% @comments.each do |comment| %> + + + + + + <% end %> +
+
+
<%= truncate(strip_tags(comment.coment), + :length => 240) %>
+
+
+
+ + +<%= link_to 'New Comment', new_comment_path %> + diff --git a/app/views/comments/index.html.erb~ b/app/views/comments/index.html.erb~ new file mode 100644 index 0000000..fe952ff --- /dev/null +++ b/app/views/comments/index.html.erb~ @@ -0,0 +1,22 @@ +

Comentarios del sitio

+ + + <% @comments.each do |comment| %> + + + + + + <% end %> +
+
+
<%= truncate(strip_tags(comment.coment), + :length => 240) %>
+
+
+ + +
+ +<%= link_to 'New Comment', new_comment_path %> + diff --git a/app/views/comments/new.html.erb b/app/views/comments/new.html.erb new file mode 100644 index 0000000..07a754a --- /dev/null +++ b/app/views/comments/new.html.erb @@ -0,0 +1,5 @@ +

New comment

+ +<%= render 'form' %> + +<%= link_to 'Back', comments_path %> diff --git a/app/views/comments/show.html.erb b/app/views/comments/show.html.erb new file mode 100644 index 0000000..fd40910 --- /dev/null +++ b/app/views/comments/show.html.erb @@ -0,0 +1,4 @@ + + + + diff --git a/app/views/comments/show.html.erb~ b/app/views/comments/show.html.erb~ new file mode 100644 index 0000000..2131ab0 --- /dev/null +++ b/app/views/comments/show.html.erb~ @@ -0,0 +1,4 @@ +

<%= notice %> + + + diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 3d2a882..12ef7ed 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -3,7 +3,10 @@ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> <%= devise_error_messages! %> -

<%= f.label :name %>
<%= f.text_field :name %>

<%= f.label :email %>
+

<%= f.label :name %>
+ <%= f.text_field :name %>

+ +
<%= f.label :email %>
<%= f.email_field :email %>
<%= f.label :password %> (leave blank if you don't want to change it)
diff --git a/app/views/devise/registrations/edit.html.erb~ b/app/views/devise/registrations/edit.html.erb~ new file mode 100644 index 0000000..6ed8bbc --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb~ @@ -0,0 +1,32 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + +<<<<<<< HEAD +
<%= f.label :name %>
+ <%= f.text_field :name %>
+ +
<%= f.label :email %>
+======= +

<%= f.label :name %>
<%= f.text_field :name %>

<%= f.label :email %>
+>>>>>>> planet2012/master + <%= f.email_field :email %>
+ +
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, :autocomplete => "off" %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password %>
+ +
<%= f.submit "Update" %>
+<% end %> + +

Cancel my account

+ +

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.

+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 79a8c31..ee8309c 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -2,8 +2,9 @@ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> +

<%= f.label :name %>
+ <%= f.text_field :name %>

-

<%= f.label :name %>
<%= f.text_field :name %>

<%= f.label :email %>
<%= f.email_field :email %>
diff --git a/app/views/devise/registrations/new.html.erb~ b/app/views/devise/registrations/new.html.erb~ new file mode 100644 index 0000000..4968aa5 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb~ @@ -0,0 +1,25 @@ +

Sign up

+ +<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> + <%= devise_error_messages! %> + +<<<<<<< HEAD +
<%= f.label :name %>
+ <%= f.text_field :name %>
+ +======= +

<%= f.label :name %>
<%= f.text_field :name %>

+>>>>>>> planet2012/master +
<%= f.label :email %>
+ <%= f.email_field :email %>
+ +
<%= f.label :password %>
+ <%= f.password_field :password %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>
+ +
<%= f.submit "Sign up" %>
+<% end %> + +<%= render "links" %> diff --git a/app/views/layouts/_search.html.erb~ b/app/views/layouts/_search.html.erb~ new file mode 100644 index 0000000..604e5e8 --- /dev/null +++ b/app/views/layouts/_search.html.erb~ @@ -0,0 +1,5 @@ +<%= form_tag :controller => 'planet', :action => 'search', :method => 'get' do %> + <%= text_field_tag :search, params[:search], :id => 'search_field' %> + <%= submit_tag "Search", :name => nil %> + <%= link_to_function "Clear", "$('search_field').clear()" %> +<% end %> diff --git a/app/views/layouts/_search_results.html.erb~ b/app/views/layouts/_search_results.html.erb~ new file mode 100644 index 0000000..1528527 --- /dev/null +++ b/app/views/layouts/_search_results.html.erb~ @@ -0,0 +1,6 @@ +
    + <% @grants.each do |grant| %> +
  • <%= link_to grant.title, + :action => 'show', :id => grant.id %>
  • + <% end %> +
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e4c9e36..e1be833 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,7 +6,11 @@ <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> - + @@ -14,22 +18,37 @@ - \ No newline at end of file + diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ new file mode 100644 index 0000000..2009182 --- /dev/null +++ b/app/views/layouts/application.html.erb~ @@ -0,0 +1,54 @@ + + + + Planet + <%= stylesheet_link_tag "application" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + + + + + + +
+
+ <%= link_to "Home", planet_index_path %>
+ <%= link_to "Tipos", types_path %>
+ <%= link_to "Tipos ordenados", ordered_index_types_path %>
+ <%= link_to "Sitios", sites_path %>
+ <%= link_to "Viajes", trips_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Sign up", new_user_registration_path unless current_user %> + <%= link_to('Documentacion',)%>
+
+
+

<%= notice %>

<%= alert %>

+ <%= yield %> +
+
+ + diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb new file mode 100644 index 0000000..7863b7c --- /dev/null +++ b/app/views/planet/author.html.erb @@ -0,0 +1,29 @@ +

Autores del sitio WEB

+ +
    + <%= image_tag('Daniel.jpg') %> +
  • Nombre: Daniel García León
  • +
  • Dirección: Calle Ramiro de Maeztu, 2
  • +
  • Mail: dgarciale@gmail.com
  • +
  • Curriculum: +
      +
    • Estudiante de 4º de Ingeniería en Telecomunicación en la Universidad Politécnica de Madrid.
    • +
    +
  • +
+ +
    + <%= image_tag('marina.JPG') %> +
  • Nombre: Marina González
  • +
  • Dirección postal: Paseo Juan XXIII, Madrid
  • +
  • Mail: m.gonzalezc@alumnos.upm.es
  • +
  • Currículum: +
      +
    • Estudiante de 4º de Ingeniería en Telecomunicación en la Universidad Politécnica de Madrid.
    • +
    +
  • +
+ + + + diff --git a/app/views/planet/author.html.erb~ b/app/views/planet/author.html.erb~ new file mode 100644 index 0000000..7863b7c --- /dev/null +++ b/app/views/planet/author.html.erb~ @@ -0,0 +1,29 @@ +

Autores del sitio WEB

+ +
    + <%= image_tag('Daniel.jpg') %> +
  • Nombre: Daniel García León
  • +
  • Dirección: Calle Ramiro de Maeztu, 2
  • +
  • Mail: dgarciale@gmail.com
  • +
  • Curriculum: +
      +
    • Estudiante de 4º de Ingeniería en Telecomunicación en la Universidad Politécnica de Madrid.
    • +
    +
  • +
+ +
    + <%= image_tag('marina.JPG') %> +
  • Nombre: Marina González
  • +
  • Dirección postal: Paseo Juan XXIII, Madrid
  • +
  • Mail: m.gonzalezc@alumnos.upm.es
  • +
  • Currículum: +
      +
    • Estudiante de 4º de Ingeniería en Telecomunicación en la Universidad Politécnica de Madrid.
    • +
    +
  • +
+ + + + diff --git a/app/views/planet/ejemplo.html.erb b/app/views/planet/ejemplo.html.erb index cb05eb9..88a3093 100644 --- a/app/views/planet/ejemplo.html.erb +++ b/app/views/planet/ejemplo.html.erb @@ -1,3 +1 @@ -

ERb: Extended Ruby

El formato ERb o .erb es HTML extendido con anotaciones Ruby, delimitadas por <% o <%= y %> , como en el siguiente ejemplo
  • Anotación no visible: <% "esto NO se ve" %>
  • Anotación visible: <%= "esto SI se ve" %>
  • Anotación no visible: <% t=Time.now %>
  • Anotación visible: <%= "hoy es: " + t.to_s %>
- -

También podemos generar un enlace al recurso (página) Home con el siguiente hiperenlace: <%= link_to('Home', planet_index_path) %>

Rails ejecuta el código Ruby y lo inserta en la página HTML antes de generar la página.

\ No newline at end of file +

ERb: Extended Ruby

El formato ERb o .erb es HTML extendido con anotaciones Ruby, delimitadas por <% o <%= y %> , como en el siguiente ejemplo
  • Anotación no visible: <% "esto NO se ve" %>
  • Anotación visible: <%= "esto SI se ve" %>
  • Anotación no visible: <% t=Time.now %>
  • Anotación visible: <%= "hoy es: " + t.to_s %>

También podemos generar un enlace al recurso (página) Home con el siguiente hiperenlace: <%= link_to('Home', planet_index_path) %>

Rails ejecuta el código Ruby y lo inserta en la página HTML antes de generar la página.

\ No newline at end of file diff --git a/app/views/planet/ejemplo.html.erb~ b/app/views/planet/ejemplo.html.erb~ new file mode 100644 index 0000000..cb05eb9 --- /dev/null +++ b/app/views/planet/ejemplo.html.erb~ @@ -0,0 +1,3 @@ +

ERb: Extended Ruby

El formato ERb o .erb es HTML extendido con anotaciones Ruby, delimitadas por <% o <%= y %> , como en el siguiente ejemplo
  • Anotación no visible: <% "esto NO se ve" %>
  • Anotación visible: <%= "esto SI se ve" %>
  • Anotación no visible: <% t=Time.now %>
  • Anotación visible: <%= "hoy es: " + t.to_s %>
+ +

También podemos generar un enlace al recurso (página) Home con el siguiente hiperenlace: <%= link_to('Home', planet_index_path) %>

Rails ejecuta el código Ruby y lo inserta en la página HTML antes de generar la página.

\ No newline at end of file diff --git a/app/views/planet/errorSearch.html.erb b/app/views/planet/errorSearch.html.erb new file mode 100644 index 0000000..60fc7e1 --- /dev/null +++ b/app/views/planet/errorSearch.html.erb @@ -0,0 +1 @@ +Error! Debe introducir 3 ó más caracteres para realizar una búsqueda
\ No newline at end of file diff --git a/app/views/planet/search.html.erb b/app/views/planet/search.html.erb new file mode 100644 index 0000000..6ee38b1 --- /dev/null +++ b/app/views/planet/search.html.erb @@ -0,0 +1,51 @@ +
+

Lista de sitios

+ + + <% @sites.each do |site| %> + + + + + + + + + <% end %> +
+ <%= link_to image_tag(site.image_url, :class => 'list_image'), site %> + +
+
<%= link_to site.name, site %>
+
<%= truncate(strip_tags(site.description), + :length => 80) %>
+
+
+ <%= link_to 'Show', site %>
+
+
+ +
+ +
+

Lista de Viajes

+ + + <% @trips.each do |trip| %> + + + + + + + <% end %> +
+
+
<%= link_to trip.name, trip_path(trip) %>
+
<%= truncate(strip_tags(trip.description), + :length => 80) + ', ' + trip.date.to_s %>
+
+
+ <%= link_to 'Show', trip %>
+
+

\ No newline at end of file diff --git a/app/views/sites/_form.html.erb b/app/views/sites/_form.html.erb index f1fd754..486e099 100644 --- a/app/views/sites/_form.html.erb +++ b/app/views/sites/_form.html.erb @@ -1,3 +1,4 @@ + <%= form_for(@site) do |f| %> <% if @site.errors.any? %>
@@ -11,7 +12,7 @@
<% end %> -
+
<%= f.label :name %>
<%= f.text_field :name %>
@@ -19,15 +20,62 @@ <%= f.label :description %>
<%= f.text_area :description , :rows => 4 %>
+
+ <%= f.label :longitud %>
+ <%= f.text_field :longitud %> +
+
+ <%= f.label :latitud %>
+ <%= f.text_field :latitud %> +
+
+ <%= f.label :zoom %>
+ <%= f.text_field :zoom %> +
+ + + + + + +
+ +
+ +
<%= f.label :type_id %>
<%= f.collection_select(:type_id, Type.find(:all, :order => :name), :id, :name) %>
- <%= f.label :image %>
- <%= f.file_field :image %> + + <%= f.label :image_url %>
+ <%= f.text_field :image_url %> +
<%= f.submit %>
+ + + + <% end %> diff --git a/app/views/sites/_form.html.erb~ b/app/views/sites/_form.html.erb~ new file mode 100644 index 0000000..a05a128 --- /dev/null +++ b/app/views/sites/_form.html.erb~ @@ -0,0 +1,81 @@ + +<%= form_for(@site) do |f| %> + <% if @site.errors.any? %> +
+

<%= pluralize(@site.errors.count, "error") %> prohibited this site from being saved:

+ +
    + <% @site.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :description %>
+ <%= f.text_area :description , :rows => 4 %> +
+
+ <%= f.label :longitud %>
+ <%= f.text_field :longitud %> +
+
+ <%= f.label :latitud %>
+ <%= f.text_field :latitud %> +
+
+ <%= f.label :zoom %>
+ <%= f.text_field :zoom %> +
+ + + + + + +
+ +
+ + +
+ <%= f.label :type_id %>
+ <%= f.collection_select(:type_id, Type.find(:all, :order => :name), :id, :name) %> +
+
+ + <%= f.label :image_url %>
+ <%= f.text_field :image_url %> + +
+
+ <%= f.submit %> +
+ + + + +<% end %> diff --git a/app/views/sites/_geo.html.erb b/app/views/sites/_geo.html.erb new file mode 100644 index 0000000..5eee787 --- /dev/null +++ b/app/views/sites/_geo.html.erb @@ -0,0 +1,48 @@ + +
+ + + + + + + + +
+ +
+ + + + diff --git a/app/views/sites/_geo.html.erb~ b/app/views/sites/_geo.html.erb~ new file mode 100644 index 0000000..d8caaa1 --- /dev/null +++ b/app/views/sites/_geo.html.erb~ @@ -0,0 +1,48 @@ + +
+ + + + + + + + +
+ +
+ + + + diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb index b8e4cae..15fe4cc 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -14,21 +14,29 @@
<%= link_to site.name, site %>
<%= truncate(strip_tags(site.description), :length => 80) %>
+ <% if site.comments !=[] %> + Existen <%= link_to 'comentarios', site %> + <% end %> + Incluido en <%=site.visits.length%> viaje<%if site.visits.length != 1%>s<%end%> - + <%= link_to 'Show', site %>
- <% if site.user == current_user %> <%= link_to 'Edit', edit_site_path(site) %>
+ <% if site.user == current_user %> + <%= link_to 'Edit', edit_site_path(site) %>
<%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %> - <% end %> + <% end %> + <% end %>
- +
-<%= link_to 'New site', new_site_path %> \ No newline at end of file +<%= link_to 'New site', new_site_path %> + + diff --git a/app/views/sites/index.html.erb~ b/app/views/sites/index.html.erb~ new file mode 100644 index 0000000..24c2359 --- /dev/null +++ b/app/views/sites/index.html.erb~ @@ -0,0 +1,42 @@ +
+

Listing Sites

+ + + <% @sites.each do |site| %> + + + + + + + + + <% end %> +
+ <%= link_to image_tag(site.image_url, :class => 'list_image'), site %> + +
+
<%= link_to site.name, site %>
+
<%= truncate(strip_tags(site.description), + :length => 80) %>
+ <% if site.comments !=[] %> + Existen <%= link_to 'comentarios', site %> + <% end %> +
+ Incluido en <%=site.visits.length%> viaje<%if site.visits.length != 1%>s<%end%> +
+ <%= link_to 'Show', site %>
+ <% if site.user == current_user %> + <%= link_to 'Edit', edit_site_path(site) %>
+ <%= link_to 'Destroy', site, + :confirm => 'Are you sure?', + :method => :delete %> + <% end %> +
+
+ +
+ +<%= link_to 'New site', new_site_path %> + + diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 01a5417..cdf36f2 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -1,19 +1,48 @@
- -

<%= @site.type.name if @site.type %>

- <%= image_tag(@site.image.url, :class => 'site_image') %> +

<%= @site.type.name if @site.type %>

+<%= image_tag(@site.image.url, :class => 'site_image') %> +

<%= @site.name %>

-

<%= @site.name %>

+

<%=sanitize @site.description %>

<%=sanitize @site.description %>

+

Coordenadas: + Longitud <%= @site.longitud %> + Latitud: <%= @site.latitud %> + Zoom: <%= @site.zoom %> -

Autor: <%= @site.user.name if @site.user %>

-
+
<%= render "geo"%>
-
- Visitas: <%= @site.visitas %> +

Autor: + <%= @site.user.name if @site.user %>

+ + +<% if @site.comments!=[] %> +Comentarios: +<%= render @site.comments %>

+ +

Añada su comentario: +<% if current_user %> + <%= render "comments/form" %>

+<%= link_to "Ingrese", new_user_session_path %> para comentar: + +<% end %> + +
Visitas: <%= @site.visitas %> + +

+ Incluido en <%=@site.visits.length%> viaje<%if @site.visits.length != 1%>s<%end%> +

-<% if @site.user == current_user %> <%= link_to 'Edit', edit_site_path(@site) %> | <% end %> <%= link_to 'Back', sites_path %> +<% if @site.user == current_user %> + <%= link_to 'Edit', edit_site_path(@site) %> | +<% end %> +<%= link_to 'Back', sites_path %> +

+ + diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ new file mode 100644 index 0000000..78868f7 --- /dev/null +++ b/app/views/sites/show.html.erb~ @@ -0,0 +1,48 @@ +
+ +

<%= @site.type.name if @site.type %>

+<%= image_tag(@site.image_url, :class => 'site_image') %> +

<%= @site.name %>

+ +

<%=sanitize @site.description %>

Coordenadas: + Longitud <%= @site.longitud %> + Latitud: <%= @site.latitud %> + Zoom: <%= @site.zoom %> + +
<%= render "geo"%>
+ +

Autor: + <%= @site.user.name if @site.user %>

+ + +<% if @site.comments!=[] %> +Comentarios: +<%= render @site.comments %>

+ +

Añada su comentario: +<% if current_user %> + <%= render "comments/form" %>

+<%= link_to "Ingrese", new_user_session_path %> para comentar: + +<% end %> + +
Visitas: <%= @site.visitas %> + +

+ Incluido en <%=@site.visits.length%> viaje<%if @site.visits.length != 1%>s<%end%> +

+
+ +

+<% if @site.user == current_user %> + <%= link_to 'Edit', edit_site_path(@site) %> | +<% end %> +<%= link_to 'Back', sites_path %> +

+ + diff --git a/app/views/trips/_form.html.erb~ b/app/views/trips/_form.html.erb~ new file mode 100644 index 0000000..3413fb2 --- /dev/null +++ b/app/views/trips/_form.html.erb~ @@ -0,0 +1,17 @@ +<%= form_for(@trip) do |f| %> + <% if @trip.errors.any? %> +
+

<%= pluralize(@trip.errors.count, "error") %> prohibited this trip from being saved:

+ +
    + <% @trip.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/trips/_trip.html.erb b/app/views/trips/_trip.html.erb index 2d69c99..689d025 100644 --- a/app/views/trips/_trip.html.erb +++ b/app/views/trips/_trip.html.erb @@ -1,29 +1,33 @@
- - <% trip.visits.order(:hour).each do |visit| %> - -
+ + <% trip.visits.order(:hour).each do |visit| %> + + + - - - + + <% end %> -
<%= link_to image_tag(visit.site.image.url, :class => 'list_image'), visit.site %> - -
+
+
<%= visit.hour.to_s + 'h: ' %> - <%=link_to(visit.site.name, visit.site) %>
+ <%=link_to(visit.site.name, visit.site) %>
<%= truncate(strip_tags(visit.site.description), :length => 80) %>
-
+
+ <%= link_to 'Show', visit.site %>
- <%= link_to 'Destroy', visit, + <%= link_to 'Destroy', visit, :confirm => 'Are you sure?', - :method => :delete if trip.user == current_user %> + :method => :delete if trip.user == current_user %> -
+
+ + + + diff --git a/app/views/trips/_trip.html.erb~ b/app/views/trips/_trip.html.erb~ new file mode 100644 index 0000000..a2261ac --- /dev/null +++ b/app/views/trips/_trip.html.erb~ @@ -0,0 +1,33 @@ +
+ + <% trip.visits.order(:hour).each do |visit| %> + + + + + + + + <% end %> +
+ <%= link_to image_tag(visit.site.image_url, :class => 'list_image'), visit.site %> + +
+
<%= visit.hour.to_s + 'h: ' %> + <%=link_to(visit.site.name, visit.site) %>
+
<%= truncate(strip_tags(visit.site.description), + :length => 80) %>
+
+
+ <%= link_to 'Show', visit.site %>
+ <%= link_to 'Destroy', visit, + :confirm => 'Are you sure?', + :method => :delete if trip.user == current_user %> + +
+
+ + + + + diff --git a/app/views/trips/index.html.erb b/app/views/trips/index.html.erb index ec66e06..4284c23 100644 --- a/app/views/trips/index.html.erb +++ b/app/views/trips/index.html.erb @@ -1 +1,30 @@ -

Viajes

<% @trips.each do |trip| %> <% end %>
<%= link_to trip.name, trip_path(trip) %>
<%= truncate(strip_tags(trip.description), :length => 80) + ', ' + trip.date.to_s %>
<%= link_to 'Show', trip %>
<% if trip.user == current_user %> <%= link_to 'Edit', edit_trip_path(trip) %>
<%= link_to 'Destroy', trip, :confirm => 'Are you sure?', :method => :delete %> <% end %>

<%= link_to 'New Trip', new_trip_path %> \ No newline at end of file +
+

Viajes

+ + + <% @trips.each do |trip| %> + + + + + + + <% end %> +
+
+
<%= link_to trip.name, trip_path(trip) %>
+
<%= truncate(strip_tags(trip.description), + :length => 80) + ', ' + trip.date.to_s %>
+
+
+ <%= link_to 'Show', trip %>
+ <% if trip.user == current_user %> + <%= link_to 'Edit', edit_trip_path(trip) %>
+ <%= link_to 'Destroy', trip, + :confirm => 'Are you sure?', + :method => :delete %> + <% end %> +
+

+ +<%= link_to 'New Trip', new_trip_path %> diff --git a/app/views/trips/index.html.erb~ b/app/views/trips/index.html.erb~ new file mode 100644 index 0000000..86fbbf0 --- /dev/null +++ b/app/views/trips/index.html.erb~ @@ -0,0 +1,30 @@ +
+

Viajes

+ + + <% @trips.each do |trip| %> + + + + + + + <% end %> +
+
+
<%= link_to trip.name, trip_path(trip) %>
+
<%= truncate(strip_tags(trip.description), + :length => 80) + ', ' + trip.date.to_s %>
+
+
+ <%= link_to 'Show', trip %>
+ <% if trip.user == current_user %> + <%= link_to 'Edit', edit_trip_path(trip) %>
+ <%= link_to 'Destroy', trip, + :confirm => 'Are you sure?', + :method => :delete %> + <% end %> +
+

+ +<%= link_to 'New Trip', new_trip_path %> diff --git a/app/views/trips/show.html.erb b/app/views/trips/show.html.erb index 8bced6a..92854a8 100644 --- a/app/views/trips/show.html.erb +++ b/app/views/trips/show.html.erb @@ -1,20 +1,80 @@ -

Name: <%= @trip.name %>

Date: <%= @trip.date %>

- Autor: <%= @trip.user.name if @trip.user %> -

-

Description: <%= simple_format @trip.description %>

+ +

+ Name: + <%= @trip.name %> +

+ +

+ Date: + <%= @trip.date %> +

+ +

+ Autor: + <%= @trip.user.name if @trip.user %> +

+ +

+ Description: + <%= simple_format @trip.description %> +

+ + + + + + + +
+

Sitios a visitar

<%= render(@trip) %> - <% if @trip.user == current_user %> + <% if @trip.user == current_user %> <%= form_for(@visit, :remote => true) do |f| %> <%= f.number_field :trip_id, :value => @trip.id, :hidden => true %> - <%= f.collection_select(:site_id, + <%= f.collection_select(:site_id, Site.all, - :id, + :id, :name) %> <%= f.select(:hour, Array.new(24, 0).fill {|i| [(i.to_s + 'H'), i]}) %> <%= f.submit "Añadir sitio" %> @@ -24,5 +84,11 @@
- <% if @trip.user == current_user %> <%= link_to 'Edit', edit_trip_path(@trip) %> | <% end %> <%= link_to 'Back', trips_path %> - \ No newline at end of file + +<% if @trip.user == current_user %> + <%= link_to 'Edit', edit_trip_path(@trip) %> | +<% end %> +<%= link_to 'Back', trips_path %> + + + diff --git a/app/views/trips/show.html.erb~ b/app/views/trips/show.html.erb~ new file mode 100644 index 0000000..ea55f10 --- /dev/null +++ b/app/views/trips/show.html.erb~ @@ -0,0 +1,94 @@ + +

+ Name: + <%= @trip.name %> +

+ +

+ Date: + <%= @trip.date %> +

+ +

+ Autor: + <%= @trip.user.name if @trip.user %> +

+ +

+ Description: + <%= simple_format @trip.description %> +

+ + + + + + + +
+ +
+ +

Sitios a visitar

+ + <%= render(@trip) %> + + <% if @trip.user == current_user %> + <%= form_for(@visit, :remote => true) do |f| %> + + <%= f.number_field :trip_id, :value => @trip.id, :hidden => true %> + <%= f.collection_select(:site_id, + Site.all, + :id, + :name) %> + <%= f.select(:hour, Array.new(24, 0).fill {|i| [(i.to_s + 'H'), i]}) %> + <%= f.submit "Añadir sitio" %> + <% end %> + <% end %> +
+ +
+ + +<% if @trip.user == current_user %> + <%= link_to 'Edit', edit_trip_path(@trip) %> | +<% end %> +<%= link_to 'Back', trips_path %> + + + diff --git a/app/views/types/index.html.erb~ b/app/views/types/index.html.erb~ new file mode 100644 index 0000000..aa159be --- /dev/null +++ b/app/views/types/index.html.erb~ @@ -0,0 +1,31 @@ +

Listing types

+ + + + + + + + + + + +<% @types.each do |type| %> + + + + + + + + +<% end %> +
NameDescriptionÚltima actualización
<%= link_to type.name, type_sites_path(type) %><%= type.description %><%= type.updated_at %><%= link_to 'Show', type %><%= link_to 'Edit', edit_type_path(type) %><%= link_to 'Destroy', type, confirm: 'Are you sure?', method: :delete %>
+ +
+ +<%= link_to 'New Type', new_type_path %> + +
+ + diff --git a/app/views/types/ordered_index.html.erb b/app/views/types/ordered_index.html.erb new file mode 100644 index 0000000..e761359 --- /dev/null +++ b/app/views/types/ordered_index.html.erb @@ -0,0 +1,30 @@ +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+
+
+ <%= link_to 'Show', type %>
+ <%= link_to 'Edit', edit_type_path(type) %>
+ <%= link_to 'Destroy', type, + :confirm => 'Are you sure?', + :method => :delete %> +
+
+ +
+ +<%= link_to 'New Type', new_type_path %> diff --git a/app/views/types/ordered_index.html.erb~ b/app/views/types/ordered_index.html.erb~ new file mode 100644 index 0000000..3741544 --- /dev/null +++ b/app/views/types/ordered_index.html.erb~ @@ -0,0 +1,29 @@ +

Listing types

+ + + + + + + + + + + +<% @types.each do |type| %> + + + + + + + + +<% end %> +
NameDescriptionÚltima actualización
<%= link_to type.name,type_sites_path(type.id) %><%= type.description %><%= type.updated_at %><%= link_to 'Show', type %><%= link_to 'Edit', edit_type_path(type) %><%= link_to 'Destroy', type, confirm: 'Are you sure?', method: :delete %>
+ +
+ +<%= link_to 'New Type', new_type_path %> + +
diff --git a/app/views/types/show.html.erb b/app/views/types/show.html.erb index 98b32e7..78022a8 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -10,6 +10,11 @@ <%= @type.description %>

+

+ Actualizado en: + <%= @type.updated_at %> +

+ <%= link_to 'Edit', edit_type_path(@type) %> | <%= link_to 'Back', types_path %> diff --git a/app/views/types/show.html.erb~ b/app/views/types/show.html.erb~ new file mode 100644 index 0000000..0b7e9b7 --- /dev/null +++ b/app/views/types/show.html.erb~ @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Name: + <%= @type.name %> +

+ +

+ Description: + <%= @type.description %> +

+ +

+ Actualizado en: + <%= @type.update_at %> +

+ + +<%= link_to 'Edit', edit_type_path(@type) %> | +<%= link_to 'Back', types_path %> diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a78d7ea..499018b 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -85,8 +85,10 @@ config.stretches = Rails.env.test? ? 1 : 10 # Setup a pepper to generate the encrypted password. + # config.pepper = "f807173825cac6c9c837bda6b02a30347a55bf933bb79161023a13d6827452aca8150a7940b27a4abf741e0159050a7b80787f789373c4a8b4475e1b2b3a47f6" + # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without # confirming his account. For instance, if set to 2.days, the user will be diff --git a/config/initializers/devise.rb~ b/config/initializers/devise.rb~ new file mode 100644 index 0000000..9e6e1b3 --- /dev/null +++ b/config/initializers/devise.rb~ @@ -0,0 +1,227 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. +# Many of these configuration options can be set straight in your model. +Devise.setup do |config| + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in Devise::Mailer, + # note that it will be overwritten if you use your own mailer class with default "from" parameter. + config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com" + + # Configure the class responsible to send e-mails. + # config.mailer = "Devise::Mailer" + + # Automatically apply schema changes in tableless databases + config.apply_schema = false + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating a user. The default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating a user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # You can also supply a hash where the value is a boolean determining whether + # or not authentication should be aborted when the value is not present. + # config.authentication_keys = [ :email ] + + # Configure parameters from the request object used for authentication. Each entry + # given should be a request method and it will automatically be passed to the + # find_for_authentication method and considered in your model lookup. For instance, + # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. + # The same considerations mentioned for authentication_keys also apply to request_keys. + # config.request_keys = [] + + # Configure which authentication keys should be case-insensitive. + # These keys will be downcased upon creating or modifying a user and when used + # to authenticate or find a user. Default is :email. + config.case_insensitive_keys = [ :email ] + + # Configure which authentication keys should have whitespace stripped. + # These keys will have whitespace before and after removed upon creating or + # modifying a user and when used to authenticate or find a user. Default is :email. + config.strip_whitespace_keys = [ :email ] + + # Tell if authentication through request.params is enabled. True by default. + # It can be set to an array that will enable params authentication only for the + # given strategies, for example, `config.params_authenticatable = [:database]` will + # enable it only for database (email + password) authentication. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Basic Auth is enabled. False by default. + # It can be set to an array that will enable http authentication only for the + # given strategies, for example, `config.http_authenticatable = [:token]` will + # enable it only for token authentication. + # config.http_authenticatable = false + + # If http headers should be returned for AJAX requests. True by default. + # config.http_authenticatable_on_xhr = true + + # The realm used in Http Basic Authentication. "Application" by default. + # config.http_authentication_realm = "Application" + + # It will change confirmation, password recovery and other workflows + # to behave the same regardless if the e-mail provided was right or wrong. + # Does not affect registerable. + # config.paranoid = true + + # By default Devise will store the user in session. You can skip storage for + # :http_auth and :token_auth by adding those symbols to the array below. + # Notice that if you are skipping storage for all authentication paths, you + # may want to disable generating routes to Devise's sessions controller by + # passing :skip => :sessions to `devise_for` in your config/routes.rb + config.skip_session_storage = [:http_auth] + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + # + # Limiting the stretches to just one in testing will increase the performance of + # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use + # a value less than 10 in other environments. + config.stretches = Rails.env.test? ? 1 : 10 + + # Setup a pepper to generate the encrypted password. +<<<<<<< HEAD + # config.pepper = "341a8860f5cb51109c2284d5c40bffeb00a8408f0a23caaf47c5a293bfac0b8f8cf9ba1055cef5c554eae881cd5704dd559e977598859c11289f70495a329fd8" +======= + # config.pepper = "f807173825cac6c9c837bda6b02a30347a55bf933bb79161023a13d6827452aca8150a7940b27a4abf741e0159050a7b80787f789373c4a8b4475e1b2b3a47f6" +>>>>>>> planet2012/master + + # ==> Configuration for :confirmable + # A period that the user is allowed to access the website even without + # confirming his account. For instance, if set to 2.days, the user will be + # able to access the website for two days without confirming his account, + # access will be blocked just in the third day. Default is 0.days, meaning + # the user cannot access the website without confirming his account. + # config.allow_unconfirmed_access_for = 2.days + + # If true, requires any email changes to be confirmed (exctly the same way as + # initial account confirmation) to be applied. Requires additional unconfirmed_email + # db field (see migrations). Until confirmed new email is stored in + # unconfirmed email column, and copied to email column on successful confirmation. + config.reconfirmable = true + + # Defines which key will be used when confirming an account + # config.confirmation_keys = [ :email ] + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # If true, uses the password salt as remember token. This should be turned + # to false if you are not using database authenticatable. + config.use_salt_as_remember_token = true + + # Options to be passed to the created cookie. For instance, you can set + # :secure => true in order to force SSL only cookies. + # config.cookie_options = {} + + # ==> Configuration for :validatable + # Range for password length. Default is 6..128. + # config.password_length = 6..128 + + # Email regex used to validate email formats. It simply asserts that + # an one (and only one) @ exists in the given string. This is mainly + # to give user feedback and not to assert the e-mail validity. + # config.email_regexp = /\A[^@]+@[^@]+\z/ + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. Default is 30 minutes. + # config.timeout_in = 30.minutes + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which key will be used when locking and unlocking an account + # config.unlock_keys = [ :email ] + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # ==> Configuration for :recoverable + # + # Defines which key will be used when recovering the password for an account + # config.reset_password_keys = [ :email ] + + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours + + # ==> Configuration for :encryptable + # Allow you to use another encryption algorithm besides bcrypt (default). You can use + # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, + # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) + # and :restful_authentication_sha1 (then you should set stretches to 10, and copy + # REST_AUTH_SITE_KEY to pepper) + # config.encryptor = :sha512 + + # ==> Configuration for :token_authenticatable + # Defines name of the authentication token params key + # config.token_authentication_key = :auth_token + + # ==> Scopes configuration + # Turn scoped views on. Before rendering "sessions/new", it will first check for + # "users/sessions/new". It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = false + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes (usually :user). + # config.default_scope = :user + + # Configure sign_out behavior. + # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope). + # The default is true, which means any logout action will sign out all active scopes. + # config.sign_out_all_scopes = true + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. + # + # The "*/*" below is required to match Internet Explorer requests. + # config.navigational_formats = ["*/*", :html] + + # The default HTTP method used to sign out a resource. Default is :delete. + config.sign_out_via = :delete + + # ==> OmniAuth + # Add a new OmniAuth provider. Check the wiki for more information on setting + # up on your models and hooks. + # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' + + # ==> Warden configuration + # If you want to use other strategies, that are not supported by Devise, or + # change the failure app, you can configure them inside the config.warden block. + # + # config.warden do |manager| + # manager.intercept_401 = false + # manager.default_strategies(:scope => :user).unshift :some_external_strategy + # end +end diff --git a/config/routes.rb b/config/routes.rb index 29d3c86..5d103f1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,7 @@ Planet::Application.routes.draw do + devise_for :users #añade rutas devise + + resources :comments resources :visits @@ -6,17 +9,25 @@ devise_for :users - resources :sites - - resources :types do # Rutas anidadas /types/id/sites..., - resources :sites, :only => [ :index ] # Restringe a acción “index” + resources :sites do + resources :comments end - - get "planet/index" - get "planet/contact" + resources :types do # Rutas anidadas /types/id/sites..., + resources :sites, :only => [ :index ] # Restringe a acción “index” + + get 'ordered_index', :on => :collection + end + + get "planet/index" - get "planet/ejemplo" + get "planet/contact" + + get "planet/ejemplo" + + get "planet/author" + + get "planet/search" # The priority is based upon order of creation: # first created -> highest priority. @@ -70,6 +81,7 @@ # root :to => 'welcome#index' root :to => "planet#index" + # See how all your routes lay out with "rake routes" diff --git a/config/routes.rb~ b/config/routes.rb~ new file mode 100644 index 0000000..28669f4 --- /dev/null +++ b/config/routes.rb~ @@ -0,0 +1,92 @@ +Planet::Application.routes.draw do + devise_for :users #añade rutas devise + + resources :comments + + resources :visits + + resources :trips + + devise_for :users + + resources :sites do + resources :comments + end + + resources :types do # Rutas anidadas /types/id/sites..., + resources :sites, :only => [ :index ] # Restringe a acción “index” + + get 'ordered_index', :on => :collection + end + + get "planet/index" + + get "planet/contact" + + get "planet/ejemplo" + + get "planet/author" + + get "planet/search" + + get "planet/doc" + # The priority is based upon order of creation: + # first created -> highest priority. + + # Sample of regular route: + # match 'products/:id' => 'catalog#view' + # Keep in mind you can assign values other than :controller and :action + + # Sample of named route: + # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase + # This route can be invoked with purchase_url(:id => product.id) + + # Sample resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Sample resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Sample resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Sample resource route with more complex sub-resources + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', :on => :collection + # end + # end + + # Sample resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end + + # You can have the root of your site routed with "root" + # just remember to delete public/index.html. + # root :to => 'welcome#index' + + root :to => "planet#index" + + + # See how all your routes lay out with "rake routes" + + # This is a legacy wild controller route that's not recommended for RESTful applications. + # Note: This route will make all actions in every controller accessible via GET requests. + # match ':controller(/:action(/:id(.:format)))' +end diff --git a/db/migrate/20120320100145_create_sites.rb b/db/migrate/20120410143500_create_sites.rb similarity index 67% rename from db/migrate/20120320100145_create_sites.rb rename to db/migrate/20120410143500_create_sites.rb index 823209a..319d1b6 100644 --- a/db/migrate/20120320100145_create_sites.rb +++ b/db/migrate/20120410143500_create_sites.rb @@ -1,11 +1,14 @@ class CreateSites < ActiveRecord::Migration def change create_table :sites do |t| + t.string :name t.text :description t.integer :type_id - t.string :image_url - + t.string :image_url + t.float :longitud + t.float :latitud + t.integer :zoom t.timestamps end end diff --git a/db/migrate/20120410143500_create_sites.rb~ b/db/migrate/20120410143500_create_sites.rb~ new file mode 100644 index 0000000..319d1b6 --- /dev/null +++ b/db/migrate/20120410143500_create_sites.rb~ @@ -0,0 +1,15 @@ +class CreateSites < ActiveRecord::Migration + def change + create_table :sites do |t| + + t.string :name + t.text :description + t.integer :type_id + t.string :image_url + t.float :longitud + t.float :latitud + t.integer :zoom + t.timestamps + end + end +end diff --git a/db/migrate/20120328230302_devise_create_users.rb b/db/migrate/20120411144942_devise_create_users.rb similarity index 100% rename from db/migrate/20120328230302_devise_create_users.rb rename to db/migrate/20120411144942_devise_create_users.rb diff --git a/db/migrate/20120329060322_user_name.rb b/db/migrate/20120411145541_user_name.rb similarity index 70% rename from db/migrate/20120329060322_user_name.rb rename to db/migrate/20120411145541_user_name.rb index 14ba63a..82e78be 100644 --- a/db/migrate/20120329060322_user_name.rb +++ b/db/migrate/20120411145541_user_name.rb @@ -1,6 +1,6 @@ class UserName < ActiveRecord::Migration def up - change_table :users do |t| # añade la columna name a la tabla sites + change_table :users do |t| #añade la columna name a la tabla sites t.column :name, :string end end diff --git a/db/migrate/20120411145541_user_name.rb~ b/db/migrate/20120411145541_user_name.rb~ new file mode 100644 index 0000000..7d0ce72 --- /dev/null +++ b/db/migrate/20120411145541_user_name.rb~ @@ -0,0 +1,13 @@ +class UserName < ActiveRecord::Migration + def up + change_table :users do |t| #añade la columna name a la tabla sites + t.column :name, :string + end + end + + def down + change table :users do |t| + t.remove :name + end + end +end diff --git a/db/migrate/20120329080433_user_sites.rb b/db/migrate/20120411151143_user_sites.rb similarity index 70% rename from db/migrate/20120329080433_user_sites.rb rename to db/migrate/20120411151143_user_sites.rb index 37bbc3b..ed4995e 100644 --- a/db/migrate/20120329080433_user_sites.rb +++ b/db/migrate/20120411151143_user_sites.rb @@ -1,6 +1,6 @@ class UserSites < ActiveRecord::Migration def up - change_table :sites do |t| # añade la columna user_id a la tabla sites + change_table :sites do |t| #añade la columna user_id a la tabla sites t.column :user_id, :integer end end diff --git a/db/migrate/20120411151143_user_sites.rb~ b/db/migrate/20120411151143_user_sites.rb~ new file mode 100644 index 0000000..0591ed2 --- /dev/null +++ b/db/migrate/20120411151143_user_sites.rb~ @@ -0,0 +1,7 @@ +class UserSites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120409085740_create_trips.rb b/db/migrate/20120411160020_create_trips.rb similarity index 99% rename from db/migrate/20120409085740_create_trips.rb rename to db/migrate/20120411160020_create_trips.rb index 9acf33c..a8f57d3 100644 --- a/db/migrate/20120409085740_create_trips.rb +++ b/db/migrate/20120411160020_create_trips.rb @@ -5,7 +5,6 @@ def change t.text :description t.date :date t.integer :user_id - t.timestamps end end diff --git a/db/migrate/20120411160020_create_trips.rb~ b/db/migrate/20120411160020_create_trips.rb~ new file mode 100644 index 0000000..a8f57d3 --- /dev/null +++ b/db/migrate/20120411160020_create_trips.rb~ @@ -0,0 +1,11 @@ +class CreateTrips < ActiveRecord::Migration + def change + create_table :trips do |t| + t.string :name + t.text :description + t.date :date + t.integer :user_id + t.timestamps + end + end +end diff --git a/db/migrate/20120413181754_create_comments.rb b/db/migrate/20120413181754_create_comments.rb new file mode 100644 index 0000000..dd5c10a --- /dev/null +++ b/db/migrate/20120413181754_create_comments.rb @@ -0,0 +1,10 @@ +class CreateComments < ActiveRecord::Migration + def change + create_table :comments do |t| + t.string :coment + t.integer :user_id + t.integer :site_id + t.timestamps + end + end +end diff --git a/db/migrate/20120413181754_create_comments.rb~ b/db/migrate/20120413181754_create_comments.rb~ new file mode 100644 index 0000000..7693f7d --- /dev/null +++ b/db/migrate/20120413181754_create_comments.rb~ @@ -0,0 +1,8 @@ +class CreateComments < ActiveRecord::Migration + def change + create_table :comments do |t| + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e6aa66f..a69ce08 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,20 +11,31 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120411160519) do +ActiveRecord::Schema.define(:version => 20120413181754) do + + create_table "comments", :force => true do |t| + t.string "coment" + t.integer "user_id" + t.integer "site_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end create_table "sites", :force => true do |t| t.string "name" t.text "description" t.integer "type_id" t.string "image_url" + t.float "longitud" + t.float "latitud" + t.integer "zoom" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "user_id" t.string "image_file_name" t.string "image_content_type" t.string "image_file_size" t.datetime "image_updated_at" + t.integer "user_id" t.integer "visitas", :default => 0 end diff --git a/db/schema.rb~ b/db/schema.rb~ new file mode 100644 index 0000000..fa9813a --- /dev/null +++ b/db/schema.rb~ @@ -0,0 +1,95 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +<<<<<<< HEAD +ActiveRecord::Schema.define(:version => 20120413181754) do + + create_table "comments", :force => true do |t| + t.string "coment" + t.integer "user_id" + t.integer "site_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end +======= +ActiveRecord::Schema.define(:version => 20120411160519) do +>>>>>>> planet2012/master + + create_table "sites", :force => true do |t| + t.string "name" + t.text "description" + t.integer "type_id" + t.string "image_url" +<<<<<<< HEAD + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" +======= + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + t.string "image_file_name" + t.string "image_content_type" + t.string "image_file_size" + t.datetime "image_updated_at" + t.integer "visitas", :default => 0 +>>>>>>> planet2012/master + end + + create_table "trips", :force => true do |t| + t.string "name" + t.text "description" + t.date "date" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "types", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "users", :force => true do |t| + t.string "email", :default => "", :null => false + t.string "encrypted_password", :default => "", :null => false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", :default => 0 + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "name" + end + + add_index "users", ["email"], :name => "index_users_on_email", :unique => true + add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true + +<<<<<<< HEAD +======= + create_table "visits", :force => true do |t| + t.integer "trip_id" + t.integer "site_id" + t.integer "hour" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +>>>>>>> planet2012/master +end diff --git a/db/seeds.rb b/db/seeds.rb index 2bda1ab..bd69f59 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -42,6 +42,9 @@ site1= Site.create!( name: 'Pedriza', description: 'Magnifico valle al norte de Madrid en el Macizo Central', + latitud: 41.129021, + longitud: -3.848877, + zoom: 8, type_id: type2.id, image_url: 'pedriza.png', image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pedriza.png'), "r")) @@ -50,6 +53,9 @@ site2 = Site.create!( name: 'Catedral de Florencia', description: 'Catedral de la ciudad de Florencia con la que se inicia el Renacimiento', + latitud: 43.772829, + longitud: 11.244135, + zoom: 8, type_id: type1.id, image_url: 'florencia.png', image: File.open(File.join(Rails.root, 'app', 'assets','images', 'florencia.png'), "r")) @@ -58,6 +64,9 @@ site3 = Site.create!( name: 'Jardin de Lineo', description: 'Jardin de la ciudad sueca de Uppsala donde el famoso naturalista tenia su coleccion de plantas', + latitud: 59.865677, + longitud: 17.635059, + zoom: 8, type_id: type1.id, image_url: 'arbol1.png', image: File.open(File.join(Rails.root, 'app', 'assets','images', 'arbol1.png'), "r")) @@ -66,6 +75,9 @@ site4 = Site.create!( name: 'Reichstag', description: 'Parlamento aleman en la ciudad de Berlin', + latitud: 52.519146, + longitud: 13.375486, + zoom: 8, type_id: type2.id, image_url: 'reichstag.png', image: File.open(File.join(Rails.root, 'app', 'assets','images', 'reichstag.png'), "r")) @@ -74,6 +86,9 @@ site5 = Site.create!( name: 'Pergamo', description: 'Puerta del mercado de la antigua ciudad griega de Pergamo del museo arquelogico de Berlin', + latitud: 47.84381, + longitud: 8.535976, + zoom: 8, type_id: type3.id, image_url: 'pergamo.png', image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pergamo.png'), "r")) diff --git a/db/seeds.rb~ b/db/seeds.rb~ new file mode 100644 index 0000000..cab3b98 --- /dev/null +++ b/db/seeds.rb~ @@ -0,0 +1,132 @@ +# This file should contain all the record creation needed to seed the +# database with its default values. The data can then be loaded with +# the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) + +Type.delete_all + +type1 = Type.create!( + name: 'Monumento', + description: 'Edificio de interes turistico o artistico') + +type2 = Type.create!( + name: 'Naturaleza', + description: 'Lugar al aire libre de interes natural o de recreo') + +type3 = Type.create!( + name: 'Ruina', + description: 'Lugar o resto de interes arquelogico') + + +User.delete_all + +user1 = User.create!( + name: 'Jose Perez', + email: 'jose.perez@gmail.com', + password: 'perez22', + password_confirmation: 'perez22') + +user2 = User.create!( + name: 'Javier Sedano', + email: 'javier.sedano@me.com', + password: 'sedano22', + password_confirmation: 'sedano22') + + +Site.delete_all + +site1= Site.create!( + name: 'Pedriza', + description: 'Magnifico valle al norte de Madrid en el Macizo Central', + latitud: 41.129021, + longitud: -3.848877, + zoom: 8, + type_id: type2.id, + image_url: 'pedriza.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pedriza.png'), "r")) +site1.user_id = user1.id ; site1.save + +site2 = Site.create!( + name: 'Catedral de Florencia', + description: 'Catedral de la ciudad de Florencia con la que se inicia el Renacimiento', + latitud: 43.772829, + longitud: 11.244135, + zoom: 8, + type_id: type1.id, + image_url: 'florencia.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'florencia.png'), "r")) +site2.user_id = user1.id ; site2.save + +site3 = Site.create!( + name: 'Jardin de Lineo', + description: 'Jardin de la ciudad sueca de Uppsala donde el famoso naturalista tenia su coleccion de plantas', + latitud: 59.865677, + longitud: 17.635059, + zoom: 8, + type_id: type1.id, + image_url: 'arbol1.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'arbol1.png'), "r")) +site3.user_id = user2.id ; site3.save + +site4 = Site.create!( + name: 'Reichstag', + description: 'Parlamento aleman en la ciudad de Berlin', + latitud: 52.519146, + longitud: 13.375486, + zoom: 8, + type_id: type2.id, + image_url: 'reichstag.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'reichstag.png'), "r")) +site4.user_id = user2.id ; site4.save + +site5 = Site.create!( + name: 'Pergamo', + description: 'Puerta del mercado de la antigua ciudad griega de Pergamo del museo arquelogico de Berlin', + latitud: 52.52395, + longitud: 13.407726, + zoom: 8, + type_id: type3.id, + image_url: 'pergamo.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pergamo.png'), "r")) +site5.user_id = user1.id ; site5.save + + + +Trip.delete_all + +trip1 = Trip.create!( + name: 'Viaje por Europa', + description: 'Viaje por capitales europeas', + date: '2012-04-12') +trip1.user_id = user1.id ; trip1.save + +trip2 = Trip.create!( + name: 'Sierra de Madrid', + description: 'Sua al Yelmo en la Pedriza', + date: '2012-05-18') +trip2.user_id = user2.id ; trip2.save + + +Visit.delete_all + +visit1 = Visit.create!( + hour: '10') +visit1.trip_id = trip2.id +visit1.site_id = site1.id ; visit1.save + +visit2 = Visit.create!( + hour: '9') +visit2.trip_id = trip1.id +visit2.site_id = site5.id ; visit2.save + +visit3 = Visit.create!( + hour: '16') +visit3.trip_id = trip1.id +visit3.site_id = site4.id ; visit3.save + + + diff --git a/doc/app/ApplicationController.html b/doc/app/ApplicationController.html index 65ef712..1f34e75 100644 --- a/doc/app/ApplicationController.html +++ b/doc/app/ApplicationController.html @@ -87,6 +87,12 @@

Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/ApplicationHelper.html b/doc/app/ApplicationHelper.html index efcf78f..b37f347 100644 --- a/doc/app/ApplicationHelper.html +++ b/doc/app/ApplicationHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Comment.html b/doc/app/Comment.html new file mode 100644 index 0000000..f2d1e40 --- /dev/null +++ b/doc/app/Comment.html @@ -0,0 +1,163 @@ + + + + + + +class Comment - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Comment

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/doc/app/CommentsController.html b/doc/app/CommentsController.html new file mode 100644 index 0000000..1e7f928 --- /dev/null +++ b/doc/app/CommentsController.html @@ -0,0 +1,451 @@ + + + + + + +class CommentsController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class CommentsController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /comments POST /comments.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 47
    +def create
    +  @site = Site.find(params[:site_id])
    +  @comment = @site.comments.create(params[:comment])
    +  @comment.user_id = current_user.id
    +
    +  respond_to do |format|
    +  if @comment.save
    +     format.html { redirect_to @site, notice: 'Comentario creado' }
    +     format.json { head :no_content }
    +  else
    +     format.html { render action: "edit" }
    +     format.json { render json: @comment.errors, status: :unprocessable_entity }
    +  end
    + end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /comments/1 DELETE /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 82
    +def destroy
    +  @site = Site.find(params[:site_id])
    +  @coment = @site.comments.find(params[:id])
    +  @coment.destroy
    +
    + respond_to do |format|
    +    format.html { redirect_to site_path(@site) }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/comments_controller.rb, line 40
    +def edit
    + @site = Site.find(params[:site_id])
    + @comment = @site.comments.find(params[:id])
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /comments GET /comments.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 5
    +def index
    +  if params[:site_id].nil? or params[:site_id].empty?
    +  @comments = Comment.all
    +  else 
    +  @comments = Site.find(params[:site_id]).comments # path: /sites/id/comment
    +  end
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @coments }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /comments/new GET /comments/new.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 31
    +def new
    +  @comment = Comment.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @comment }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /comments/1 GET /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 20
    +def show
    +  @comment = Comment.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @comment }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /comments/1 PUT /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 65
    +  def update
    +@site = Site.find(params[:site_id])
    +@comment = @site.comments.find(params[:id])
    +
    +respond_to do |format|
    +if @comment.update_attributes(params[:comment])
    +format.html { redirect_to @site, notice: 'Comentario actualizado' }
    +format.json { head :no_content }
    +else
    +format.html { render action: "edit" }
    +format.json { render json: @comment.errors, status: :unprocessable_entity }
    +end
    +end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/doc/app/CommentsHelper.html b/doc/app/CommentsHelper.html new file mode 100644 index 0000000..efa0a4d --- /dev/null +++ b/doc/app/CommentsHelper.html @@ -0,0 +1,157 @@ + + + + + + +module CommentsHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module CommentsHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/doc/app/PlanetController.html b/doc/app/PlanetController.html index e3bde99..a5759dd 100644 --- a/doc/app/PlanetController.html +++ b/doc/app/PlanetController.html @@ -76,6 +76,8 @@

    Methods

  • #index +
  • #search + @@ -101,6 +103,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -214,7 +222,7 @@

    Public Instance Methods

    -
    # File app/controllers/planet_controller.rb, line 28
    +            
    # File app/controllers/planet_controller.rb, line 27
     def contact
     end
    @@ -243,7 +251,7 @@

    Public Instance Methods

    -
    # File app/controllers/planet_controller.rb, line 31
    +            
    # File app/controllers/planet_controller.rb, line 30
     def ejemplo
     end
    @@ -272,7 +280,7 @@

    Public Instance Methods

    -
    # File app/controllers/planet_controller.rb, line 25
    +            
    # File app/controllers/planet_controller.rb, line 24
     def index
     end
    @@ -285,6 +293,41 @@

    Public Instance Methods

  • + + + diff --git a/doc/app/PlanetHelper.html b/doc/app/PlanetHelper.html index 578d307..520e392 100644 --- a/doc/app/PlanetHelper.html +++ b/doc/app/PlanetHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Site.html b/doc/app/Site.html index 3c8b96c..263a976 100644 --- a/doc/app/Site.html +++ b/doc/app/Site.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/SitesController.html b/doc/app/SitesController.html index c02b5c6..696cea2 100644 --- a/doc/app/SitesController.html +++ b/doc/app/SitesController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -186,10 +192,10 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 50
    +            
    # File app/controllers/sites_controller.rb, line 49
     def create
       @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user
    -  
    +
       respond_to do |format|
         if @site.save
           format.html { redirect_to @site, notice: 'Site was successfully created.' }
    @@ -226,7 +232,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 82
    +            
    # File app/controllers/sites_controller.rb, line 81
     def destroy
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user
       @site.destroy
    @@ -262,7 +268,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 44
    +            
    # File app/controllers/sites_controller.rb, line 43
     def edit
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user
     end
    @@ -292,18 +298,18 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 9
    +            
    # File app/controllers/sites_controller.rb, line 8
     def index
    -  if params[:type_id].nil? or params[:type_id].empty?
    -    @sites = Site.all            # path: /types
    -    else
    -    @sites = Type.find(params[:type_id]).sites  # path: /types/id/sites
    -  end
    -  respond_to do |format|
    -    format.html # index.html.erb
    -    format.json { render json: @sites }
    -  end
    -end
    + if params[:type_id].nil? or params[:type_id].empty? + @sites = Site.all # path: /types + else + @sites = Type.find(params[:type_id]).sites # path: /types/id/sites + end + respond_to do |format| + format.html # index.html.erb + format.json { render json: @sites } + end + end
    @@ -330,10 +336,10 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 34
    +            
    # File app/controllers/sites_controller.rb, line 33
     def new
       @site = current_user.sites.build # crea sitio vacio asociado a current_user
    -  
    +
       respond_to do |format|
         format.html # new.html.erb
         format.json { render json: @site }
    @@ -365,7 +371,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 23
    +            
    # File app/controllers/sites_controller.rb, line 22
     def show
       @site = Site.find(params[:id])
     
    @@ -400,10 +406,10 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 66
    +            
    # File app/controllers/sites_controller.rb, line 65
     def update
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user 
    -  
    +
       respond_to do |format|
         if @site.update_attributes(params[:site])
           format.html { redirect_to @site, notice: 'Site was successfully updated.' }
    diff --git a/doc/app/SitesHelper.html b/doc/app/SitesHelper.html
    index aa932c6..ca14c80 100644
    --- a/doc/app/SitesHelper.html
    +++ b/doc/app/SitesHelper.html
    @@ -81,6 +81,12 @@ 

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Trip.html b/doc/app/Trip.html index 9a51e94..f83874c 100644 --- a/doc/app/Trip.html +++ b/doc/app/Trip.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/TripsController.html b/doc/app/TripsController.html index abfde19..f825f0c 100644 --- a/doc/app/TripsController.html +++ b/doc/app/TripsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -186,7 +192,7 @@

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 47
    +            
    # File app/controllers/trips_controller.rb, line 46
     def create
       @trip = current_user.trips.build(params[:trip])
     
    @@ -226,7 +232,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 79
    +            
    # File app/controllers/trips_controller.rb, line 78
     def destroy
       @trip = current_user.trips.find(params[:id])
       @trip.destroy
    @@ -262,7 +268,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 41
    +            
    # File app/controllers/trips_controller.rb, line 40
     def edit
       @trip = current_user.trips.find(params[:id])
     end
    @@ -327,7 +333,7 @@

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 31
    +            
    # File app/controllers/trips_controller.rb, line 30
     def new
       @trip = current_user.trips.build
       
    @@ -366,7 +372,6 @@ 

    Public Instance Methods

    def show @trip = Trip.find(params[:id]) @visit = @trip.visits.build - respond_to do |format| format.html # show.html.erb format.json { render json: @trip } @@ -398,7 +403,7 @@

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 63
    +            
    # File app/controllers/trips_controller.rb, line 62
     def update
       @trip = current_user.trips.find(params[:id])
       
    diff --git a/doc/app/TripsHelper.html b/doc/app/TripsHelper.html
    index 7d08398..20d1cc4 100644
    --- a/doc/app/TripsHelper.html
    +++ b/doc/app/TripsHelper.html
    @@ -81,6 +81,12 @@ 

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Type.html b/doc/app/Type.html index c9f3a24..0dd1429 100644 --- a/doc/app/Type.html +++ b/doc/app/Type.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/TypesController.html b/doc/app/TypesController.html index e69e052..d4ae1a8 100644 --- a/doc/app/TypesController.html +++ b/doc/app/TypesController.html @@ -80,6 +80,8 @@

    Methods

  • #new +
  • #ordered_index +
  • #show
  • #update @@ -109,6 +111,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -346,6 +354,35 @@

    Public Instance Methods

  • +
    + +
    + ordered_index() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/types_controller.rb, line 84
    +def ordered_index
    +end
    +
    + +
    + + + + +
    + +
    diff --git a/doc/app/TypesHelper.html b/doc/app/TypesHelper.html index d7e732d..c49a519 100644 --- a/doc/app/TypesHelper.html +++ b/doc/app/TypesHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/User.html b/doc/app/User.html index 5fa3862..19f3ed7 100644 --- a/doc/app/User.html +++ b/doc/app/User.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Visit.html b/doc/app/Visit.html index ad56b8f..67d89ed 100644 --- a/doc/app/Visit.html +++ b/doc/app/Visit.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/VisitsController.html b/doc/app/VisitsController.html index 00709aa..c22b02a 100644 --- a/doc/app/VisitsController.html +++ b/doc/app/VisitsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/VisitsHelper.html b/doc/app/VisitsHelper.html index 4ff2034..4ded92a 100644 --- a/doc/app/VisitsHelper.html +++ b/doc/app/VisitsHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/created.rid b/doc/app/created.rid index 2aaa3ea..74ddf9f 100644 --- a/doc/app/created.rid +++ b/doc/app/created.rid @@ -1,19 +1,22 @@ -Mon, 16 Apr 2012 08:53:15 +0200 -doc/README_FOR_APP Sat, 17 Mar 2012 23:42:41 +0100 -app/controllers/application_controller.rb Sat, 17 Mar 2012 23:42:41 +0100 -app/controllers/planet_controller.rb Mon, 16 Apr 2012 08:53:07 +0200 -app/controllers/sites_controller.rb Thu, 12 Apr 2012 11:23:00 +0200 -app/controllers/trips_controller.rb Mon, 09 Apr 2012 17:09:15 +0200 -app/controllers/types_controller.rb Sun, 18 Mar 2012 00:15:37 +0100 -app/controllers/visits_controller.rb Tue, 10 Apr 2012 18:45:27 +0200 -app/helpers/application_helper.rb Sat, 17 Mar 2012 23:42:41 +0100 -app/helpers/planet_helper.rb Sat, 17 Mar 2012 23:48:05 +0100 -app/helpers/sites_helper.rb Tue, 20 Mar 2012 11:01:45 +0100 -app/helpers/trips_helper.rb Mon, 09 Apr 2012 10:57:40 +0200 -app/helpers/types_helper.rb Sun, 18 Mar 2012 00:15:37 +0100 -app/helpers/visits_helper.rb Mon, 09 Apr 2012 17:09:15 +0200 -app/models/site.rb Wed, 11 Apr 2012 13:04:49 +0200 -app/models/trip.rb Mon, 09 Apr 2012 17:09:15 +0200 -app/models/type.rb Wed, 28 Mar 2012 18:02:57 +0200 -app/models/user.rb Mon, 09 Apr 2012 17:09:15 +0200 -app/models/visit.rb Mon, 09 Apr 2012 17:09:15 +0200 +Wed, 25 Apr 2012 16:00:56 +0200 +doc/README_FOR_APP Fri, 20 Apr 2012 14:02:14 +0200 +app/controllers/planet_controller.rb Wed, 25 Apr 2012 15:43:11 +0200 +app/controllers/application_controller.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/controllers/types_controller.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/controllers/visits_controller.rb Tue, 17 Apr 2012 17:45:06 +0200 +app/controllers/comments_controller.rb Sun, 15 Apr 2012 14:00:52 +0200 +app/controllers/trips_controller.rb Tue, 17 Apr 2012 08:57:41 +0200 +app/controllers/sites_controller.rb Tue, 17 Apr 2012 17:43:55 +0200 +app/models/comment.rb Tue, 17 Apr 2012 09:27:11 +0200 +app/models/site.rb Wed, 25 Apr 2012 15:53:47 +0200 +app/models/visit.rb Tue, 17 Apr 2012 08:50:12 +0200 +app/models/trip.rb Tue, 17 Apr 2012 08:58:41 +0200 +app/models/user.rb Tue, 17 Apr 2012 09:25:47 +0200 +app/models/type.rb Tue, 17 Apr 2012 08:59:14 +0200 +app/helpers/trips_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/sites_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/comments_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/types_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/visits_helper.rb Tue, 17 Apr 2012 08:50:12 +0200 +app/helpers/planet_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/application_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 diff --git a/doc/app/doc/README_FOR_APP.html b/doc/app/doc/README_FOR_APP.html index cfe337b..1255c65 100644 --- a/doc/app/doc/README_FOR_APP.html +++ b/doc/app/doc/README_FOR_APP.html @@ -63,6 +63,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/images/add.png b/doc/app/images/add.png old mode 100755 new mode 100644 diff --git a/doc/app/images/delete.png b/doc/app/images/delete.png old mode 100755 new mode 100644 diff --git a/doc/app/images/tag_blue.png b/doc/app/images/tag_blue.png old mode 100755 new mode 100644 diff --git a/doc/app/index.html b/doc/app/index.html index a944adb..e48336d 100644 --- a/doc/app/index.html +++ b/doc/app/index.html @@ -63,6 +63,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/js/search_index.js b/doc/app/js/search_index.js index f5703f3..b0ca577 100644 --- a/doc/app/js/search_index.js +++ b/doc/app/js/search_index.js @@ -1 +1 @@ -var search_data = {"index":{"searchIndex":["applicationcontroller","applicationhelper","planetcontroller","planethelper","site","sitescontroller","siteshelper","trip","tripscontroller","tripshelper","type","typescontroller","typeshelper","user","visit","visitscontroller","visitshelper","contact()","create()","create()","create()","create()","destroy()","destroy()","destroy()","destroy()","edit()","edit()","edit()","edit()","ejemplo()","index()","index()","index()","index()","index()","new()","new()","new()","new()","show()","show()","show()","show()","update()","update()","update()","update()","readme_for_app"],"longSearchIndex":["applicationcontroller","applicationhelper","planetcontroller","planethelper","site","sitescontroller","siteshelper","trip","tripscontroller","tripshelper","type","typescontroller","typeshelper","user","visit","visitscontroller","visitshelper","planetcontroller#contact()","sitescontroller#create()","tripscontroller#create()","typescontroller#create()","visitscontroller#create()","sitescontroller#destroy()","tripscontroller#destroy()","typescontroller#destroy()","visitscontroller#destroy()","sitescontroller#edit()","tripscontroller#edit()","typescontroller#edit()","visitscontroller#edit()","planetcontroller#ejemplo()","planetcontroller#index()","sitescontroller#index()","tripscontroller#index()","typescontroller#index()","visitscontroller#index()","sitescontroller#new()","tripscontroller#new()","typescontroller#new()","visitscontroller#new()","sitescontroller#show()","tripscontroller#show()","typescontroller#show()","visitscontroller#show()","sitescontroller#update()","tripscontroller#update()","typescontroller#update()","visitscontroller#update()",""],"info":[["ApplicationController","","ApplicationController.html","",""],["ApplicationHelper","","ApplicationHelper.html","",""],["PlanetController","","PlanetController.html","","

    PlanetController ilustra el uso de RDoc. La documentación\nde un proyecto en genera en el directorio …\n"],["PlanetHelper","","PlanetHelper.html","",""],["Site","","Site.html","",""],["SitesController","","SitesController.html","",""],["SitesHelper","","SitesHelper.html","",""],["Trip","","Trip.html","",""],["TripsController","","TripsController.html","",""],["TripsHelper","","TripsHelper.html","",""],["Type","","Type.html","",""],["TypesController","","TypesController.html","",""],["TypesHelper","","TypesHelper.html","",""],["User","","User.html","",""],["Visit","","Visit.html","",""],["VisitsController","","VisitsController.html","",""],["VisitsHelper","","VisitsHelper.html","",""],["contact","PlanetController","PlanetController.html#method-i-contact","()","

    Método que define una acción vacía del controlador\n"],["create","SitesController","SitesController.html#method-i-create","()","

    POST /sites POST /sites.json\n"],["create","TripsController","TripsController.html#method-i-create","()","

    POST /trips POST /trips.json\n"],["create","TypesController","TypesController.html#method-i-create","()","

    POST /types POST /types.json\n"],["create","VisitsController","VisitsController.html#method-i-create","()","

    POST /visits POST /visits.json\n"],["destroy","SitesController","SitesController.html#method-i-destroy","()","

    DELETE /sites/1 DELETE /sites/1.json\n"],["destroy","TripsController","TripsController.html#method-i-destroy","()","

    DELETE /trips/1 DELETE /trips/1.json\n"],["destroy","TypesController","TypesController.html#method-i-destroy","()","

    DELETE /types/1 DELETE /types/1.json\n"],["destroy","VisitsController","VisitsController.html#method-i-destroy","()","

    DELETE /visits/1 DELETE /visits/1.json\n"],["edit","SitesController","SitesController.html#method-i-edit","()","

    GET /sites/1/edit\n"],["edit","TripsController","TripsController.html#method-i-edit","()","

    GET /trips/1/edit\n"],["edit","TypesController","TypesController.html#method-i-edit","()","

    GET /types/1/edit\n"],["edit","VisitsController","VisitsController.html#method-i-edit","()","

    GET /visits/1/edit\n"],["ejemplo","PlanetController","PlanetController.html#method-i-ejemplo","()","

    Método que define una acción vacía del controlador\n"],["index","PlanetController","PlanetController.html#method-i-index","()","

    Método que define una acción vacía del controlador\n"],["index","SitesController","SitesController.html#method-i-index","()","

    GET /sites GET /sites.json\n"],["index","TripsController","TripsController.html#method-i-index","()","

    GET /trips GET /trips.json\n"],["index","TypesController","TypesController.html#method-i-index","()","

    GET /types GET /types.json\n"],["index","VisitsController","VisitsController.html#method-i-index","()","

    GET /visits GET /visits.json\n"],["new","SitesController","SitesController.html#method-i-new","()","

    GET /sites/new GET /sites/new.json\n"],["new","TripsController","TripsController.html#method-i-new","()","

    GET /trips/new GET /trips/new.json\n"],["new","TypesController","TypesController.html#method-i-new","()","

    GET /types/new GET /types/new.json\n"],["new","VisitsController","VisitsController.html#method-i-new","()","

    GET /visits/new GET /visits/new.json\n"],["show","SitesController","SitesController.html#method-i-show","()","

    GET /sites/1 GET /sites/1.json\n"],["show","TripsController","TripsController.html#method-i-show","()","

    GET /trips/1 GET /trips/1.json\n"],["show","TypesController","TypesController.html#method-i-show","()","

    GET /types/1 GET /types/1.json\n"],["show","VisitsController","VisitsController.html#method-i-show","()","

    GET /visits/1 GET /visits/1.json\n"],["update","SitesController","SitesController.html#method-i-update","()","

    PUT /sites/1 PUT /sites/1.json\n"],["update","TripsController","TripsController.html#method-i-update","()","

    PUT /trips/1 PUT /trips/1.json\n"],["update","TypesController","TypesController.html#method-i-update","()","

    PUT /types/1 PUT /types/1.json\n"],["update","VisitsController","VisitsController.html#method-i-update","()","

    PUT /visits/1 PUT /visits/1.json\n"],["README_FOR_APP","","doc/README_FOR_APP.html","","

    Use this README file to introduce your application and point to useful\nplaces in the API for learning …\n"]]}} \ No newline at end of file +var search_data = {"index":{"searchIndex":["applicationcontroller","applicationhelper","comment","commentscontroller","commentshelper","planetcontroller","planethelper","site","sitescontroller","siteshelper","trip","tripscontroller","tripshelper","type","typescontroller","typeshelper","user","visit","visitscontroller","visitshelper","contact()","create()","create()","create()","create()","create()","destroy()","destroy()","destroy()","destroy()","destroy()","edit()","edit()","edit()","edit()","edit()","ejemplo()","index()","index()","index()","index()","index()","index()","new()","new()","new()","new()","new()","ordered_index()","search()","show()","show()","show()","show()","show()","update()","update()","update()","update()","update()","readme_for_app"],"longSearchIndex":["applicationcontroller","applicationhelper","comment","commentscontroller","commentshelper","planetcontroller","planethelper","site","sitescontroller","siteshelper","trip","tripscontroller","tripshelper","type","typescontroller","typeshelper","user","visit","visitscontroller","visitshelper","planetcontroller#contact()","commentscontroller#create()","sitescontroller#create()","tripscontroller#create()","typescontroller#create()","visitscontroller#create()","commentscontroller#destroy()","sitescontroller#destroy()","tripscontroller#destroy()","typescontroller#destroy()","visitscontroller#destroy()","commentscontroller#edit()","sitescontroller#edit()","tripscontroller#edit()","typescontroller#edit()","visitscontroller#edit()","planetcontroller#ejemplo()","commentscontroller#index()","planetcontroller#index()","sitescontroller#index()","tripscontroller#index()","typescontroller#index()","visitscontroller#index()","commentscontroller#new()","sitescontroller#new()","tripscontroller#new()","typescontroller#new()","visitscontroller#new()","typescontroller#ordered_index()","planetcontroller#search()","commentscontroller#show()","sitescontroller#show()","tripscontroller#show()","typescontroller#show()","visitscontroller#show()","commentscontroller#update()","sitescontroller#update()","tripscontroller#update()","typescontroller#update()","visitscontroller#update()",""],"info":[["ApplicationController","","ApplicationController.html","",""],["ApplicationHelper","","ApplicationHelper.html","",""],["Comment","","Comment.html","",""],["CommentsController","","CommentsController.html","",""],["CommentsHelper","","CommentsHelper.html","",""],["PlanetController","","PlanetController.html","","

    PlanetController ilustra el uso de RDoc. La documentación\nde un proyecto en genera en el directorio …\n"],["PlanetHelper","","PlanetHelper.html","",""],["Site","","Site.html","",""],["SitesController","","SitesController.html","",""],["SitesHelper","","SitesHelper.html","",""],["Trip","","Trip.html","",""],["TripsController","","TripsController.html","",""],["TripsHelper","","TripsHelper.html","",""],["Type","","Type.html","",""],["TypesController","","TypesController.html","",""],["TypesHelper","","TypesHelper.html","",""],["User","","User.html","",""],["Visit","","Visit.html","",""],["VisitsController","","VisitsController.html","",""],["VisitsHelper","","VisitsHelper.html","",""],["contact","PlanetController","PlanetController.html#method-i-contact","()","

    Método que define una acción vacía del controlador\n"],["create","CommentsController","CommentsController.html#method-i-create","()","

    POST /comments POST /comments.json\n"],["create","SitesController","SitesController.html#method-i-create","()","

    POST /sites POST /sites.json\n"],["create","TripsController","TripsController.html#method-i-create","()","

    POST /trips POST /trips.json\n"],["create","TypesController","TypesController.html#method-i-create","()","

    POST /types POST /types.json\n"],["create","VisitsController","VisitsController.html#method-i-create","()","

    POST /visits POST /visits.json\n"],["destroy","CommentsController","CommentsController.html#method-i-destroy","()","

    DELETE /comments/1 DELETE /comments/1.json\n"],["destroy","SitesController","SitesController.html#method-i-destroy","()","

    DELETE /sites/1 DELETE /sites/1.json\n"],["destroy","TripsController","TripsController.html#method-i-destroy","()","

    DELETE /trips/1 DELETE /trips/1.json\n"],["destroy","TypesController","TypesController.html#method-i-destroy","()","

    DELETE /types/1 DELETE /types/1.json\n"],["destroy","VisitsController","VisitsController.html#method-i-destroy","()","

    DELETE /visits/1 DELETE /visits/1.json\n"],["edit","CommentsController","CommentsController.html#method-i-edit","()",""],["edit","SitesController","SitesController.html#method-i-edit","()","

    GET /sites/1/edit\n"],["edit","TripsController","TripsController.html#method-i-edit","()","

    GET /trips/1/edit\n"],["edit","TypesController","TypesController.html#method-i-edit","()","

    GET /types/1/edit\n"],["edit","VisitsController","VisitsController.html#method-i-edit","()","

    GET /visits/1/edit\n"],["ejemplo","PlanetController","PlanetController.html#method-i-ejemplo","()","

    Método que define una acción vacía del controlador\n"],["index","CommentsController","CommentsController.html#method-i-index","()","

    GET /comments GET /comments.json\n"],["index","PlanetController","PlanetController.html#method-i-index","()","

    Método que define una acción vacía del controlador\n"],["index","SitesController","SitesController.html#method-i-index","()","

    GET /sites GET /sites.json\n"],["index","TripsController","TripsController.html#method-i-index","()","

    GET /trips GET /trips.json\n"],["index","TypesController","TypesController.html#method-i-index","()","

    GET /types GET /types.json\n"],["index","VisitsController","VisitsController.html#method-i-index","()","

    GET /visits GET /visits.json\n"],["new","CommentsController","CommentsController.html#method-i-new","()","

    GET /comments/new GET /comments/new.json\n"],["new","SitesController","SitesController.html#method-i-new","()","

    GET /sites/new GET /sites/new.json\n"],["new","TripsController","TripsController.html#method-i-new","()","

    GET /trips/new GET /trips/new.json\n"],["new","TypesController","TypesController.html#method-i-new","()","

    GET /types/new GET /types/new.json\n"],["new","VisitsController","VisitsController.html#method-i-new","()","

    GET /visits/new GET /visits/new.json\n"],["ordered_index","TypesController","TypesController.html#method-i-ordered_index","()",""],["search","PlanetController","PlanetController.html#method-i-search","()",""],["show","CommentsController","CommentsController.html#method-i-show","()","

    GET /comments/1 GET /comments/1.json\n"],["show","SitesController","SitesController.html#method-i-show","()","

    GET /sites/1 GET /sites/1.json\n"],["show","TripsController","TripsController.html#method-i-show","()","

    GET /trips/1 GET /trips/1.json\n"],["show","TypesController","TypesController.html#method-i-show","()","

    GET /types/1 GET /types/1.json\n"],["show","VisitsController","VisitsController.html#method-i-show","()","

    GET /visits/1 GET /visits/1.json\n"],["update","CommentsController","CommentsController.html#method-i-update","()","

    PUT /comments/1 PUT /comments/1.json\n"],["update","SitesController","SitesController.html#method-i-update","()","

    PUT /sites/1 PUT /sites/1.json\n"],["update","TripsController","TripsController.html#method-i-update","()","

    PUT /trips/1 PUT /trips/1.json\n"],["update","TypesController","TypesController.html#method-i-update","()","

    PUT /types/1 PUT /types/1.json\n"],["update","VisitsController","VisitsController.html#method-i-update","()","

    PUT /visits/1 PUT /visits/1.json\n"],["README_FOR_APP","","doc/README_FOR_APP.html","","

    Use this README file to introduce your application and point to useful\nplaces in the API for learning …\n"]]}} \ No newline at end of file diff --git a/doc/app/table_of_contents.html b/doc/app/table_of_contents.html index cf87ce4..4fd480b 100644 --- a/doc/app/table_of_contents.html +++ b/doc/app/table_of_contents.html @@ -38,6 +38,15 @@

    Classes/Modules

  • ApplicationHelper +
  • +
  • + Comment +
  • +
  • + CommentsController +
  • +
  • + CommentsHelper
  • PlanetController @@ -97,64 +106,82 @@

    Methods

  • #contact — PlanetController -
  • #create — TypesController +
  • #create — VisitsController + +
  • #create — CommentsController
  • #create — SitesController +
  • #create — TypesController +
  • #create — TripsController -
  • #create — VisitsController +
  • #destroy — SitesController + +
  • #destroy — CommentsController + +
  • #destroy — VisitsController
  • #destroy — TripsController
  • #destroy — TypesController -
  • #destroy — VisitsController +
  • #edit — VisitsController -
  • #destroy — SitesController +
  • #edit — SitesController
  • #edit — TripsController
  • #edit — TypesController -
  • #edit — VisitsController - -
  • #edit — SitesController +
  • #edit — CommentsController
  • #ejemplo — PlanetController -
  • #index — VisitsController +
  • #index — TripsController -
  • #index — SitesController +
  • #index — VisitsController -
  • #index — TripsController +
  • #index — CommentsController
  • #index — TypesController +
  • #index — SitesController +
  • #index — PlanetController +
  • #new — CommentsController +
  • #new — TypesController
  • #new — SitesController -
  • #new — TripsController -
  • #new — VisitsController -
  • #show — TripsController +
  • #new — TripsController -
  • #show — TypesController +
  • #ordered_index — TypesController + +
  • #search — PlanetController
  • #show — SitesController
  • #show — VisitsController -
  • #update — SitesController +
  • #show — TypesController + +
  • #show — TripsController + +
  • #show — CommentsController
  • #update — TypesController
  • #update — VisitsController +
  • #update — CommentsController + +
  • #update — SitesController +
  • #update — TripsController diff --git a/public/doc/app/ApplicationController.html b/public/doc/app/ApplicationController.html new file mode 100644 index 0000000..1f34e75 --- /dev/null +++ b/public/doc/app/ApplicationController.html @@ -0,0 +1,163 @@ + + + + + + +class ApplicationController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class ApplicationController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/ApplicationHelper.html b/public/doc/app/ApplicationHelper.html new file mode 100644 index 0000000..b37f347 --- /dev/null +++ b/public/doc/app/ApplicationHelper.html @@ -0,0 +1,157 @@ + + + + + + +module ApplicationHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module ApplicationHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/Comment.html b/public/doc/app/Comment.html new file mode 100644 index 0000000..f2d1e40 --- /dev/null +++ b/public/doc/app/Comment.html @@ -0,0 +1,163 @@ + + + + + + +class Comment - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Comment

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/CommentsController.html b/public/doc/app/CommentsController.html new file mode 100644 index 0000000..1e7f928 --- /dev/null +++ b/public/doc/app/CommentsController.html @@ -0,0 +1,451 @@ + + + + + + +class CommentsController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class CommentsController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /comments POST /comments.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 47
    +def create
    +  @site = Site.find(params[:site_id])
    +  @comment = @site.comments.create(params[:comment])
    +  @comment.user_id = current_user.id
    +
    +  respond_to do |format|
    +  if @comment.save
    +     format.html { redirect_to @site, notice: 'Comentario creado' }
    +     format.json { head :no_content }
    +  else
    +     format.html { render action: "edit" }
    +     format.json { render json: @comment.errors, status: :unprocessable_entity }
    +  end
    + end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /comments/1 DELETE /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 82
    +def destroy
    +  @site = Site.find(params[:site_id])
    +  @coment = @site.comments.find(params[:id])
    +  @coment.destroy
    +
    + respond_to do |format|
    +    format.html { redirect_to site_path(@site) }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/comments_controller.rb, line 40
    +def edit
    + @site = Site.find(params[:site_id])
    + @comment = @site.comments.find(params[:id])
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /comments GET /comments.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 5
    +def index
    +  if params[:site_id].nil? or params[:site_id].empty?
    +  @comments = Comment.all
    +  else 
    +  @comments = Site.find(params[:site_id]).comments # path: /sites/id/comment
    +  end
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @coments }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /comments/new GET /comments/new.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 31
    +def new
    +  @comment = Comment.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @comment }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /comments/1 GET /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 20
    +def show
    +  @comment = Comment.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @comment }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /comments/1 PUT /comments/1.json

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 65
    +  def update
    +@site = Site.find(params[:site_id])
    +@comment = @site.comments.find(params[:id])
    +
    +respond_to do |format|
    +if @comment.update_attributes(params[:comment])
    +format.html { redirect_to @site, notice: 'Comentario actualizado' }
    +format.json { head :no_content }
    +else
    +format.html { render action: "edit" }
    +format.json { render json: @comment.errors, status: :unprocessable_entity }
    +end
    +end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/CommentsHelper.html b/public/doc/app/CommentsHelper.html new file mode 100644 index 0000000..efa0a4d --- /dev/null +++ b/public/doc/app/CommentsHelper.html @@ -0,0 +1,157 @@ + + + + + + +module CommentsHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module CommentsHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/PlanetController.html b/public/doc/app/PlanetController.html new file mode 100644 index 0000000..a5759dd --- /dev/null +++ b/public/doc/app/PlanetController.html @@ -0,0 +1,343 @@ + + + + + + +class PlanetController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class PlanetController

    + +
    + +

    PlanetController ilustra el uso de +RDoc. La documentación de un proyecto en genera en el +directorio proy/doc en formato Web con

    + +
    $proy> rake doc:app
    + +

    Algunos comandos de formateo

    + +

    Tal y como muestra el subitulo anterior, este se define empezando la línea +con ==. En los títulos debe empezar por =.

    + +

    Un [ … ] seguido de texto define una lista titulada, como aquí

    +
    Clases, Módulos o Métodos +
    +

    Se documentan con comentarios justo encima de sus definición, como aquí.

    +
    + +

    Un * o - definen las entradas de una lista itemizada

    + + +

    Un número o letra seguido de punto genera una lista númerada

    +
    1. +

      + permite generar negrita, igual que con +HTML

      +
    2. +

      _ permite generar cursiva, igual que con HTML

      +
      • +

        permite generar letra de teletipo, igual que con +HTML

        +
      +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + contact() + click to toggle source +
    + + +
    + +

    Método que define una acción vacía del controlador

    + + + +
    +
    # File app/controllers/planet_controller.rb, line 27
    +def contact
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + ejemplo() + click to toggle source +
    + + +
    + +

    Método que define una acción vacía del controlador

    + + + +
    +
    # File app/controllers/planet_controller.rb, line 30
    +def ejemplo
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    Método que define una acción vacía del controlador

    + + + +
    +
    # File app/controllers/planet_controller.rb, line 24
    +def index
    +end
    +
    + +
    + + + + +
    + + + + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/PlanetHelper.html b/public/doc/app/PlanetHelper.html new file mode 100644 index 0000000..520e392 --- /dev/null +++ b/public/doc/app/PlanetHelper.html @@ -0,0 +1,157 @@ + + + + + + +module PlanetHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module PlanetHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/Site.html b/public/doc/app/Site.html new file mode 100644 index 0000000..263a976 --- /dev/null +++ b/public/doc/app/Site.html @@ -0,0 +1,163 @@ + + + + + + +class Site - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Site

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/SitesController.html b/public/doc/app/SitesController.html new file mode 100644 index 0000000..696cea2 --- /dev/null +++ b/public/doc/app/SitesController.html @@ -0,0 +1,445 @@ + + + + + + +class SitesController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class SitesController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /sites POST /sites.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 49
    +def create
    +  @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user
    +
    +  respond_to do |format|
    +    if @site.save
    +      format.html { redirect_to @site, notice: 'Site was successfully created.' }
    +      format.json { render json: @site, status: :created, location: @site }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @site.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /sites/1 DELETE /sites/1.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 81
    +def destroy
    +  @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user
    +  @site.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to sites_url }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /sites/1/edit

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 43
    +def edit
    +  @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /sites GET /sites.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 8
    +def index
    +   if params[:type_id].nil? or params[:type_id].empty?
    +     @sites = Site.all # path: /types
    +     else
    +     @sites = Type.find(params[:type_id]).sites # path: /types/id/sites
    +   end
    +   respond_to do |format|
    +     format.html # index.html.erb
    +     format.json { render json: @sites }
    +   end
    + end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /sites/new GET /sites/new.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 33
    +def new
    +  @site = current_user.sites.build # crea sitio vacio asociado a current_user
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @site }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /sites/1 GET /sites/1.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 22
    +def show
    +  @site = Site.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @site }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /sites/1 PUT /sites/1.json

    + + + +
    +
    # File app/controllers/sites_controller.rb, line 65
    +def update
    +  @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user 
    +
    +  respond_to do |format|
    +    if @site.update_attributes(params[:site])
    +      format.html { redirect_to @site, notice: 'Site was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @site.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/SitesHelper.html b/public/doc/app/SitesHelper.html new file mode 100644 index 0000000..ca14c80 --- /dev/null +++ b/public/doc/app/SitesHelper.html @@ -0,0 +1,157 @@ + + + + + + +module SitesHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module SitesHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/Trip.html b/public/doc/app/Trip.html new file mode 100644 index 0000000..f83874c --- /dev/null +++ b/public/doc/app/Trip.html @@ -0,0 +1,163 @@ + + + + + + +class Trip - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Trip

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/TripsController.html b/public/doc/app/TripsController.html new file mode 100644 index 0000000..f825f0c --- /dev/null +++ b/public/doc/app/TripsController.html @@ -0,0 +1,442 @@ + + + + + + +class TripsController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class TripsController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /trips POST /trips.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 46
    +def create
    +  @trip = current_user.trips.build(params[:trip])
    +
    +  respond_to do |format|
    +    if @trip.save
    +      format.html { redirect_to @trip, notice: 'Trip was successfully created.' }
    +      format.json { render json: @trip, status: :created, location: @trip }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @trip.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /trips/1 DELETE /trips/1.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 78
    +def destroy
    +  @trip = current_user.trips.find(params[:id])
    +  @trip.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to trips_url }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /trips/1/edit

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 40
    +def edit
    +  @trip = current_user.trips.find(params[:id])
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /trips GET /trips.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 8
    +def index
    +  @trips = Trip.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @trips }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /trips/new GET /trips/new.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 30
    +def new
    +  @trip = current_user.trips.build
    +  
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @trip }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /trips/1 GET /trips/1.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 19
    +def show
    +  @trip = Trip.find(params[:id])
    +  @visit = @trip.visits.build
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @trip }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /trips/1 PUT /trips/1.json

    + + + +
    +
    # File app/controllers/trips_controller.rb, line 62
    +def update
    +  @trip = current_user.trips.find(params[:id])
    +  
    +  respond_to do |format|
    +    if @trip.update_attributes(params[:trip])
    +      format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @trip.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/TripsHelper.html b/public/doc/app/TripsHelper.html new file mode 100644 index 0000000..20d1cc4 --- /dev/null +++ b/public/doc/app/TripsHelper.html @@ -0,0 +1,157 @@ + + + + + + +module TripsHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module TripsHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/Type.html b/public/doc/app/Type.html new file mode 100644 index 0000000..0dd1429 --- /dev/null +++ b/public/doc/app/Type.html @@ -0,0 +1,163 @@ + + + + + + +class Type - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Type

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/TypesController.html b/public/doc/app/TypesController.html new file mode 100644 index 0000000..d4ae1a8 --- /dev/null +++ b/public/doc/app/TypesController.html @@ -0,0 +1,473 @@ + + + + + + +class TypesController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class TypesController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /types POST /types.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 42
    +def create
    +  @type = Type.new(params[:type])
    +
    +  respond_to do |format|
    +    if @type.save
    +      format.html { redirect_to @type, notice: 'Type was successfully created.' }
    +      format.json { render json: @type, status: :created, location: @type }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @type.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /types/1 DELETE /types/1.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 74
    +def destroy
    +  @type = Type.find(params[:id])
    +  @type.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to types_url }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /types/1/edit

    + + + +
    +
    # File app/controllers/types_controller.rb, line 36
    +def edit
    +  @type = Type.find(params[:id])
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /types GET /types.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 4
    +def index
    +  @types = Type.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @types }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /types/new GET /types/new.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 26
    +def new
    +  @type = Type.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @type }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + ordered_index() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/types_controller.rb, line 84
    +def ordered_index
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /types/1 GET /types/1.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 15
    +def show
    +  @type = Type.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @type }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /types/1 PUT /types/1.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 58
    +def update
    +  @type = Type.find(params[:id])
    +
    +  respond_to do |format|
    +    if @type.update_attributes(params[:type])
    +      format.html { redirect_to @type, notice: 'Type was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @type.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/TypesHelper.html b/public/doc/app/TypesHelper.html new file mode 100644 index 0000000..c49a519 --- /dev/null +++ b/public/doc/app/TypesHelper.html @@ -0,0 +1,157 @@ + + + + + + +module TypesHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module TypesHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/User.html b/public/doc/app/User.html new file mode 100644 index 0000000..19f3ed7 --- /dev/null +++ b/public/doc/app/User.html @@ -0,0 +1,163 @@ + + + + + + +class User - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class User

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/Visit.html b/public/doc/app/Visit.html new file mode 100644 index 0000000..67d89ed --- /dev/null +++ b/public/doc/app/Visit.html @@ -0,0 +1,163 @@ + + + + + + +class Visit - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class Visit

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/VisitsController.html b/public/doc/app/VisitsController.html new file mode 100644 index 0000000..c22b02a --- /dev/null +++ b/public/doc/app/VisitsController.html @@ -0,0 +1,443 @@ + + + + + + +class VisitsController - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    class VisitsController

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    +

    Public Instance Methods

    + + +
    + +
    + create() + click to toggle source +
    + + +
    + +

    POST /visits POST /visits.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 42
    +def create
    +  @visit = Visit.new(params[:visit])
    +
    +  respond_to do |format|
    +    if @visit.save
    +      format.html { redirect_to @visit.trip, notice: 'Visit was successfully created.' }
    +      format.js
    +      format.json { render json: @visit, status: :created, location: @visit }
    +    else
    +      format.html { render action: "new" }
    +      format.json { render json: @visit.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + destroy() + click to toggle source +
    + + +
    + +

    DELETE /visits/1 DELETE /visits/1.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 75
    +def destroy
    +  @visit = Visit.find(params[:id])
    +  @visit.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to @visit.trip }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /visits/1/edit

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 36
    +def edit
    +  @visit = Visit.find(params[:id])
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + index() + click to toggle source +
    + + +
    + +

    GET /visits GET /visits.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 4
    +def index
    +  @visits = Visit.all
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @visits }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + new() + click to toggle source +
    + + +
    + +

    GET /visits/new GET /visits/new.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 26
    +def new
    +  @visit = Visit.new
    +
    +  respond_to do |format|
    +    format.html # new.html.erb
    +    format.json { render json: @visit }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + show() + click to toggle source +
    + + +
    + +

    GET /visits/1 GET /visits/1.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 15
    +def show
    +  @visit = Visit.find(params[:id])
    +
    +  respond_to do |format|
    +    format.html # show.html.erb
    +    format.json { render json: @visit }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + update() + click to toggle source +
    + + +
    + +

    PUT /visits/1 PUT /visits/1.json

    + + + +
    +
    # File app/controllers/visits_controller.rb, line 59
    +def update
    +  @visit = Visit.find(params[:id])
    +
    +  respond_to do |format|
    +    if @visit.update_attributes(params[:visit])
    +      format.html { redirect_to @visit.trip, notice: 'Visit was successfully updated.' }
    +      format.json { head :no_content }
    +    else
    +      format.html { render action: "edit" }
    +      format.json { render json: @visit.errors, status: :unprocessable_entity }
    +    end
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + +
    + + + + diff --git a/public/doc/app/VisitsHelper.html b/public/doc/app/VisitsHelper.html new file mode 100644 index 0000000..4ded92a --- /dev/null +++ b/public/doc/app/VisitsHelper.html @@ -0,0 +1,157 @@ + + + + + + +module VisitsHelper - Rails Application Documentation + + + + + + + + + + + + + + + + +
    +

    module VisitsHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/public/doc/app/created.rid b/public/doc/app/created.rid new file mode 100644 index 0000000..74ddf9f --- /dev/null +++ b/public/doc/app/created.rid @@ -0,0 +1,22 @@ +Wed, 25 Apr 2012 16:00:56 +0200 +doc/README_FOR_APP Fri, 20 Apr 2012 14:02:14 +0200 +app/controllers/planet_controller.rb Wed, 25 Apr 2012 15:43:11 +0200 +app/controllers/application_controller.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/controllers/types_controller.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/controllers/visits_controller.rb Tue, 17 Apr 2012 17:45:06 +0200 +app/controllers/comments_controller.rb Sun, 15 Apr 2012 14:00:52 +0200 +app/controllers/trips_controller.rb Tue, 17 Apr 2012 08:57:41 +0200 +app/controllers/sites_controller.rb Tue, 17 Apr 2012 17:43:55 +0200 +app/models/comment.rb Tue, 17 Apr 2012 09:27:11 +0200 +app/models/site.rb Wed, 25 Apr 2012 15:53:47 +0200 +app/models/visit.rb Tue, 17 Apr 2012 08:50:12 +0200 +app/models/trip.rb Tue, 17 Apr 2012 08:58:41 +0200 +app/models/user.rb Tue, 17 Apr 2012 09:25:47 +0200 +app/models/type.rb Tue, 17 Apr 2012 08:59:14 +0200 +app/helpers/trips_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/sites_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/comments_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/types_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/visits_helper.rb Tue, 17 Apr 2012 08:50:12 +0200 +app/helpers/planet_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 +app/helpers/application_helper.rb Sun, 15 Apr 2012 11:20:48 +0200 diff --git a/public/doc/app/doc/README_FOR_APP.html b/public/doc/app/doc/README_FOR_APP.html new file mode 100644 index 0000000..1255c65 --- /dev/null +++ b/public/doc/app/doc/README_FOR_APP.html @@ -0,0 +1,123 @@ + + + + + + +README_FOR_APP - Rails Application Documentation + + + + + + + + + + + + + + + + +
    + +

    Use this README file to introduce your application and point to useful +places in the API for learning more. Run “rake doc:app” to generate API +documentation for your models, controllers, helpers, and libraries.

    + +
    + + + + + diff --git a/public/doc/app/images/add.png b/public/doc/app/images/add.png new file mode 100644 index 0000000..6332fef Binary files /dev/null and b/public/doc/app/images/add.png differ diff --git a/public/doc/app/images/brick.png b/public/doc/app/images/brick.png new file mode 100644 index 0000000..7851cf3 Binary files /dev/null and b/public/doc/app/images/brick.png differ diff --git a/public/doc/app/images/brick_link.png b/public/doc/app/images/brick_link.png new file mode 100644 index 0000000..9ebf013 Binary files /dev/null and b/public/doc/app/images/brick_link.png differ diff --git a/public/doc/app/images/bug.png b/public/doc/app/images/bug.png new file mode 100644 index 0000000..2d5fb90 Binary files /dev/null and b/public/doc/app/images/bug.png differ diff --git a/public/doc/app/images/bullet_black.png b/public/doc/app/images/bullet_black.png new file mode 100644 index 0000000..5761970 Binary files /dev/null and b/public/doc/app/images/bullet_black.png differ diff --git a/public/doc/app/images/bullet_toggle_minus.png b/public/doc/app/images/bullet_toggle_minus.png new file mode 100644 index 0000000..b47ce55 Binary files /dev/null and b/public/doc/app/images/bullet_toggle_minus.png differ diff --git a/public/doc/app/images/bullet_toggle_plus.png b/public/doc/app/images/bullet_toggle_plus.png new file mode 100644 index 0000000..9ab4a89 Binary files /dev/null and b/public/doc/app/images/bullet_toggle_plus.png differ diff --git a/public/doc/app/images/date.png b/public/doc/app/images/date.png new file mode 100644 index 0000000..783c833 Binary files /dev/null and b/public/doc/app/images/date.png differ diff --git a/public/doc/app/images/delete.png b/public/doc/app/images/delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/public/doc/app/images/delete.png differ diff --git a/public/doc/app/images/find.png b/public/doc/app/images/find.png new file mode 100644 index 0000000..1547479 Binary files /dev/null and b/public/doc/app/images/find.png differ diff --git a/public/doc/app/images/loadingAnimation.gif b/public/doc/app/images/loadingAnimation.gif new file mode 100644 index 0000000..82290f4 Binary files /dev/null and b/public/doc/app/images/loadingAnimation.gif differ diff --git a/public/doc/app/images/macFFBgHack.png b/public/doc/app/images/macFFBgHack.png new file mode 100644 index 0000000..c6473b3 Binary files /dev/null and b/public/doc/app/images/macFFBgHack.png differ diff --git a/public/doc/app/images/package.png b/public/doc/app/images/package.png new file mode 100644 index 0000000..da3c2a2 Binary files /dev/null and b/public/doc/app/images/package.png differ diff --git a/public/doc/app/images/page_green.png b/public/doc/app/images/page_green.png new file mode 100644 index 0000000..de8e003 Binary files /dev/null and b/public/doc/app/images/page_green.png differ diff --git a/public/doc/app/images/page_white_text.png b/public/doc/app/images/page_white_text.png new file mode 100644 index 0000000..813f712 Binary files /dev/null and b/public/doc/app/images/page_white_text.png differ diff --git a/public/doc/app/images/page_white_width.png b/public/doc/app/images/page_white_width.png new file mode 100644 index 0000000..1eb8809 Binary files /dev/null and b/public/doc/app/images/page_white_width.png differ diff --git a/public/doc/app/images/plugin.png b/public/doc/app/images/plugin.png new file mode 100644 index 0000000..6187b15 Binary files /dev/null and b/public/doc/app/images/plugin.png differ diff --git a/public/doc/app/images/ruby.png b/public/doc/app/images/ruby.png new file mode 100644 index 0000000..f763a16 Binary files /dev/null and b/public/doc/app/images/ruby.png differ diff --git a/public/doc/app/images/tag_blue.png b/public/doc/app/images/tag_blue.png new file mode 100644 index 0000000..3f02b5f Binary files /dev/null and b/public/doc/app/images/tag_blue.png differ diff --git a/public/doc/app/images/tag_green.png b/public/doc/app/images/tag_green.png new file mode 100644 index 0000000..83ec984 Binary files /dev/null and b/public/doc/app/images/tag_green.png differ diff --git a/public/doc/app/images/transparent.png b/public/doc/app/images/transparent.png new file mode 100644 index 0000000..d665e17 Binary files /dev/null and b/public/doc/app/images/transparent.png differ diff --git a/public/doc/app/images/wrench.png b/public/doc/app/images/wrench.png new file mode 100644 index 0000000..5c8213f Binary files /dev/null and b/public/doc/app/images/wrench.png differ diff --git a/public/doc/app/images/wrench_orange.png b/public/doc/app/images/wrench_orange.png new file mode 100644 index 0000000..565a933 Binary files /dev/null and b/public/doc/app/images/wrench_orange.png differ diff --git a/public/doc/app/images/zoom.png b/public/doc/app/images/zoom.png new file mode 100644 index 0000000..908612e Binary files /dev/null and b/public/doc/app/images/zoom.png differ diff --git a/public/doc/app/index.html b/public/doc/app/index.html new file mode 100644 index 0000000..e48336d --- /dev/null +++ b/public/doc/app/index.html @@ -0,0 +1,116 @@ + + + + + + +Rails Application Documentation + + + + + + + + + + + + + + + + +

    This is the API documentation for Rails Application Documentation. + + +

    + diff --git a/public/doc/app/js/darkfish.js b/public/doc/app/js/darkfish.js new file mode 100644 index 0000000..4be722f --- /dev/null +++ b/public/doc/app/js/darkfish.js @@ -0,0 +1,153 @@ +/** + * + * Darkfish Page Functions + * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* Provide console simulation for firebug-less environments */ +if (!("console" in window) || !("firebug" in console)) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +}; + + +/** + * Unwrap the first element that matches the given @expr@ from the targets and return them. + */ +$.fn.unwrap = function( expr ) { + return this.each( function() { + $(this).parents( expr ).eq( 0 ).after( this ).remove(); + }); +}; + + +function showSource( e ) { + var target = e.target; + var codeSections = $(target). + parents('.method-detail'). + find('.method-source-code'); + + $(target). + parents('.method-detail'). + find('.method-source-code'). + slideToggle(); +}; + +function hookSourceViews() { + $('.method-heading').click( showSource ); +}; + +function toggleDebuggingSection() { + $('.debugging-section').slideToggle(); +}; + +function hookDebuggingToggle() { + $('#debugging-toggle img').click( toggleDebuggingSection ); +}; + +function hookTableOfContentsToggle() { + $('.indexpage li .toc-toggle').each( function() { + $(this).click( function() { + $(this).toggleClass('open'); + }); + + var section = $(this).next(); + + $(this).click( function() { + section.slideToggle(); + }); + }); +} + +function hookSearch() { + var input = $('#search-field').eq(0); + var result = $('#search-results').eq(0); + $(result).show(); + + var search_section = $('#search-section').get(0); + $(search_section).show(); + + var search = new Search(search_data, input, result); + + search.renderItem = function(result) { + var li = document.createElement('li'); + var html = ''; + + // TODO add relative path to + + + + + + + + + + +

    Table of Contents - Rails Application Documentation

    + +

    Pages

    + + +

    Classes/Modules

    + + +

    Methods

    + + + + + diff --git a/test/fixtures/comentarios.yml b/test/fixtures/comentarios.yml new file mode 100644 index 0000000..29c9999 --- /dev/null +++ b/test/fixtures/comentarios.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + comment: MyString + user_id: 1 + site_id: 1 + +two: + comment: MyString + user_id: 1 + site_id: 1 diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml new file mode 100644 index 0000000..00c41be --- /dev/null +++ b/test/fixtures/comments.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + coment: MyText + user_id: 1 + site_id: 1 + +two: + coment: MyText + user_id: 1 + site_id: 1 diff --git a/test/fixtures/comments.yml~ b/test/fixtures/comments.yml~ new file mode 100644 index 0000000..a54d559 --- /dev/null +++ b/test/fixtures/comments.yml~ @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + coment: MyText + site_id: 1 + +two: + coment: MyText + site_id: 1 diff --git a/test/fixtures/sites.yml~ b/test/fixtures/sites.yml~ new file mode 100644 index 0000000..2b6293d --- /dev/null +++ b/test/fixtures/sites.yml~ @@ -0,0 +1,28 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +<<<<<<< HEAD +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value +======= +one: + name: MyString + description: MyText + type: one + image_url: MyString + user: one + +two: + name: YourString + description: YourText + type: two + image_url: YourString + user: two + +>>>>>>> planet2012/master diff --git a/test/fixtures/trips.yml b/test/fixtures/trips.yml index e093bcf..ccdadb3 100644 --- a/test/fixtures/trips.yml +++ b/test/fixtures/trips.yml @@ -11,3 +11,5 @@ two: description: YourText date: 2012-04-09 user: two + + diff --git a/test/fixtures/trips.yml~ b/test/fixtures/trips.yml~ new file mode 100644 index 0000000..0a8e915 --- /dev/null +++ b/test/fixtures/trips.yml~ @@ -0,0 +1,21 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# + +one: + name: MyString + description: MyText + date: 2012-04-09 + user: one + +two: + name: YourString + description: YourText + date: 2012-04-09 + user: one + + diff --git a/test/fixtures/types.yml b/test/fixtures/types.yml index 49a7b4e..bf3a571 100644 --- a/test/fixtures/types.yml +++ b/test/fixtures/types.yml @@ -9,4 +9,13 @@ two: description: YourText -# Podriamos añadir nuevos datos de inicialización, que se referencian como # -> types(:monumento) types(:naturaleza) monumento: name: Monumento description: “Edificio o construcción de valor historico” naturaleza: name: Naturaleza description: “Lugar al aire libre de interés natural” \ No newline at end of file +# Podriamos añadir nuevos datos de inicialización, que se referencian como +# -> types(:monumento) types(:naturaleza) + +monumento: + name: Monumento + description: “Edificio o construcción de valor historico” + +naturaleza: + name: Naturaleza + description: “Lugar al aire libre de interés natural” diff --git a/test/fixtures/types.yml~ b/test/fixtures/types.yml~ new file mode 100644 index 0000000..033b44f --- /dev/null +++ b/test/fixtures/types.yml~ @@ -0,0 +1,25 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + name: MyString + description: MyText + +two: + name: YourString + description: YourText + +<<<<<<< HEAD +# Podriamos añadir nuevos datos de inicialización, que se referencian como +# -> types(:monumento) types(:naturaleza) + +monumento: + name: Monumento + description: “Edificio o construcción de valor historico” + +naturaleza: + name: Naturaleza + description: “Lugar al aire libre de interés natural” +======= + +# Podriamos añadir nuevos datos de inicialización, que se referencian como # -> types(:monumento) types(:naturaleza) monumento: name: Monumento description: “Edificio o construcción de valor historico” naturaleza: name: Naturaleza description: “Lugar al aire libre de interés natural” +>>>>>>> planet2012/master diff --git a/test/fixtures/users.yml~ b/test/fixtures/users.yml~ new file mode 100644 index 0000000..764cf8c --- /dev/null +++ b/test/fixtures/users.yml~ @@ -0,0 +1,18 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# + +one: + name: Jose Perez + email: jose.perez@gmail.com + encrypted_password: perez22222 +# column: value +# +two: + name: Jose Perez + email: jose.perez@me.com + encrypted_password: perez33333 +# column: value diff --git a/test/fixtures/visits.yml~ b/test/fixtures/visits.yml~ new file mode 100644 index 0000000..22d3657 --- /dev/null +++ b/test/fixtures/visits.yml~ @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + trip: one + site: one + hour: 9 + +two: + trip: two + site: two + hour: 9 diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb new file mode 100644 index 0000000..b2b500c --- /dev/null +++ b/test/functional/comments_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class CommentsControllerTest < ActionController::TestCase + setup do + @comment = comments(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:comments) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create comment" do + assert_difference('Comment.count') do + post :create, comment: @comment.attributes + end + + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should show comment" do + get :show, id: @comment + assert_response :success + end + + test "should get edit" do + get :edit, id: @comment + assert_response :success + end + + test "should update comment" do + put :update, id: @comment, comment: @comment.attributes + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should destroy comment" do + assert_difference('Comment.count', -1) do + delete :destroy, id: @comment + end + + assert_redirected_to comments_path + end +end diff --git a/test/functional/comments_controller_test.rb~ b/test/functional/comments_controller_test.rb~ new file mode 100644 index 0000000..f8522ca --- /dev/null +++ b/test/functional/comments_controller_test.rb~ @@ -0,0 +1,49 @@ +require 'test_helper' + +class CommentsControllerTest < ActionController::TestCase + setup do + @comment = comments(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:comments) + end + + test "should get new" do + get :new, site_id: @comment + assert_response :success + end + + test "should create comment" do + assert_difference('Comment.count') do + post :create, site_id: @comment, comment: @comment.attributes + end + + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should show comment" do + get :show, id: @comment + assert_response :success + end + + test "should get edit" do + get :edit, id: @comment, site_id: @comment + assert_response :success + end + + test "should update comment" do + put :update, site_id: @comment, id: @comment, comment: @comment.attributes + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should destroy comment" do + assert_difference('Comment.count', -1) do + delete :destroy, site_id: @comment, id: @comment + end + + assert_redirected_to comments_path + end +end diff --git a/test/functional/planet_controller_test.rb b/test/functional/planet_controller_test.rb index ce15d1b..0c28d47 100644 --- a/test/functional/planet_controller_test.rb +++ b/test/functional/planet_controller_test.rb @@ -1,6 +1,9 @@ require 'test_helper' class PlanetControllerTest < ActionController::TestCase + setup do + @busqueda = "MyString" + end test "should get index" do get :index @@ -12,4 +15,18 @@ class PlanetControllerTest < ActionController::TestCase assert_response :success end + test "should get ejemplo" do + get :ejemplo + assert_response :success + end + + test "should get author" do + get :author + assert_response :success + end + + test "should get search" do + get :search, busqueda: @busqueda + assert_response :success + end end diff --git a/test/functional/planet_controller_test.rb~ b/test/functional/planet_controller_test.rb~ new file mode 100644 index 0000000..6ae8b65 --- /dev/null +++ b/test/functional/planet_controller_test.rb~ @@ -0,0 +1,32 @@ +require 'test_helper' + +class PlanetControllerTest < ActionController::TestCase + setup do + @busqueda = "MyString" + end + + test "should get index" do + get :index + assert_response :success + end + + test "should get contact" do + get :contact + assert_response :success + end + + test "should get ejemplo" do + get :ejemplo + assert_response :success + end + + test "should get author" do + get :author + assert_response :success + end + + test "should get search" do + get :search, buscar: @busqueda + assert_response :success + end +end diff --git a/test/functional/sites_controller_test.rb~ b/test/functional/sites_controller_test.rb~ new file mode 100644 index 0000000..05d1ae7 --- /dev/null +++ b/test/functional/sites_controller_test.rb~ @@ -0,0 +1,56 @@ +require 'test_helper' + +class SitesControllerTest < ActionController::TestCase + setup do + @site = sites(:one) + @update = { # @update: parametros diferentes + :name => 'AnotherType', + :description => 'AnotherText', + :type_id => types(:one).id + } + @user = @site.user + sign_in @user + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:sites) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create site" do + assert_difference('Site.count') do + post :create, site: @update + end + + assert_redirected_to site_path(assigns(:site)) + end + + test "should show site" do + get :show, id: @site + assert_response :success + end + + test "should get edit" do + get :edit, id: @site + assert_response :success + end + + test "should update site" do + put :update, id: @site, site: @update + assert_redirected_to site_path(assigns(:site)) + end + + test "should destroy site" do + assert_difference('Site.count', -1) do + delete :destroy, id: @site + end + + assert_redirected_to sites_path + end +end diff --git a/test/functional/trips_controller_test.rb~ b/test/functional/trips_controller_test.rb~ new file mode 100644 index 0000000..4f794b2 --- /dev/null +++ b/test/functional/trips_controller_test.rb~ @@ -0,0 +1,57 @@ +require 'test_helper' + +class TripsControllerTest < ActionController::TestCase + setup do + @trip = trips(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:trips) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create trip" do + assert_difference('Trip.count') do +<<<<<<< HEAD + post :create, trip: @trip.attributes +======= + post :create, trip: @update +>>>>>>> planet2012/master + end + + assert_redirected_to trip_path(assigns(:trip)) + end + + test "should show trip" do + get :show, id: @trip + assert_response :success + end + + test "should get edit" do + get :edit, id: @trip + assert_response :success + end + + test "should update trip" do +<<<<<<< HEAD + put :update, id: @trip, trip: @trip.attributes +======= + put :update, id: @trip, trip: @update +>>>>>>> planet2012/master + assert_redirected_to trip_path(assigns(:trip)) + end + + test "should destroy trip" do + assert_difference('Trip.count', -1) do + delete :destroy, id: @trip + end + + assert_redirected_to trips_path + end +end diff --git a/test/functional/types_controller_test.rb~ b/test/functional/types_controller_test.rb~ new file mode 100644 index 0000000..e1ba613 --- /dev/null +++ b/test/functional/types_controller_test.rb~ @@ -0,0 +1,70 @@ +require 'test_helper' + +class TypesControllerTest < ActionController::TestCase + setup do + @type = types(:one) +<<<<<<< HEAD + @update = { # @update: parametros diferentes + :name => 'AnotherType', + :description => 'AnotherText', + } +======= + @update = { # @update: parametros diferentes + :name => 'AnotherType', + :description => 'AnotherText', + } + @user = users(:one) + sign_in @user +>>>>>>> planet2012/master + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:types) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create type" do + assert_difference('Type.count') do +<<<<<<< HEAD + post :create, type => @update +======= + post :create, type: @update +>>>>>>> planet2012/master + end + + assert_redirected_to type_path(assigns(:type)) + end + + test "should show type" do + get :show, id: @type + assert_response :success + end + + test "should get edit" do + get :edit, id: @type + assert_response :success + end + + test "should update type" do +<<<<<<< HEAD + put :update, id => @type, type=> @update +======= + put :update, id: @type, type: @update +>>>>>>> planet2012/master + assert_redirected_to type_path(assigns(:type)) + end + + test "should destroy type" do + assert_difference('Type.count', -1) do + delete :destroy, id: @type + end + + assert_redirected_to types_path + end +end diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb new file mode 100644 index 0000000..b6d6131 --- /dev/null +++ b/test/unit/comment_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CommentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb new file mode 100644 index 0000000..2518c16 --- /dev/null +++ b/test/unit/helpers/comments_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class CommentsHelperTest < ActionView::TestCase +end diff --git a/test/unit/site_test.rb~ b/test/unit/site_test.rb~ new file mode 100644 index 0000000..a21c1ca --- /dev/null +++ b/test/unit/site_test.rb~ @@ -0,0 +1,21 @@ +require 'test_helper' + +class SiteTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + + # site creado sin atributos es invalido y genera errores + test "Site attributes must not be empty" do + site = Site.new + assert site.invalid? # Test pasa si validación no pasa + assert site.errors[:name].any? + assert not(site.errors[:description].any?) + assert site.errors[:type_id].any? +<<<<<<< HEAD + assert site.errors[:image_url].any? +======= + # assert site.errors[:image_url].any? not used with paperclip +>>>>>>> planet2012/master + end +end diff --git a/test/unit/type_test.rb~ b/test/unit/type_test.rb~ new file mode 100644 index 0000000..0ce1172 --- /dev/null +++ b/test/unit/type_test.rb~ @@ -0,0 +1,7 @@ +require 'test_helper' + +class TypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end