diff --git a/.gitignore b/.gitignore index 4a4d70e..c0f9050 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,11 @@ # ignore al .DS_store files of MAC OSX .DS_Store +<<<<<<< HEAD +*~ +======= # ignore paperclip installation files public/system -.project \ No newline at end of file +.project +>>>>>>> upstream/master diff --git a/Gemfile b/Gemfile index ec2ba7b..3ca0ed4 100644 --- a/Gemfile +++ b/Gemfile @@ -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..698392a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -55,12 +55,13 @@ GEM 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) + multi_json (1.3.2) orm_adapter (0.0.7) paperclip (3.0.2) activemodel (>= 3.0.0) @@ -104,7 +105,9 @@ 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) @@ -124,6 +127,7 @@ DEPENDENCIES cleditor_rails coffee-rails (~> 3.2.1) devise + execjs jquery-rails json (= 1.6.5) paperclip @@ -131,4 +135,5 @@ DEPENDENCIES rails (= 3.2.2) sass-rails (~> 3.2.3) sqlite3 + therubyracer uglifier (>= 1.0.3) diff --git a/README b/README new file mode 100644 index 0000000..c8f68c2 --- /dev/null +++ b/README @@ -0,0 +1 @@ +All that's missing is the fork. Heh. \ No newline at end of file diff --git a/app/assets/images/fran.jpg b/app/assets/images/fran.jpg new file mode 100644 index 0000000..fdfda70 Binary files /dev/null and b/app/assets/images/fran.jpg differ diff --git a/app/assets/images/jq6.jpg b/app/assets/images/jq6.jpg new file mode 100644 index 0000000..2dceac4 Binary files /dev/null and b/app/assets/images/jq6.jpg differ diff --git a/app/assets/images/mandi.png b/app/assets/images/mandi.png new file mode 100644 index 0000000..4e990ff Binary files /dev/null and b/app/assets/images/mandi.png differ 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 index 50d53e3..92b7de4 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -12,3 +12,10 @@ *= require cleditor *= require_tree . */ + +html, body { +width: 100%; height: 100%; +} +#imagen{ + max-width: 70%; +} diff --git a/app/assets/stylesheets/comments.css.scss b/app/assets/stylesheets/comments.css.scss new file mode 100644 index 0000000..e730912 --- /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/sites.css.scss b/app/assets/stylesheets/sites.css.scss index 682e55c..3b6bd81 100644 --- a/app/assets/stylesheets/sites.css.scss +++ b/app/assets/stylesheets/sites.css.scss @@ -1,3 +1,4 @@ // Place all the styles related to the sites controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8065d9..ea2c60c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery + + def doc + end end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 0000000..473c6dc --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,87 @@ +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 + end + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @comments } + 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 + + # GET /comments/1/edit + def edit + @comment = Comment.find(params[:id]) + end + + # POST /comments + # POST /comments.json + def create + @comment = Comment.new(params[:comment]) + + respond_to do |format| + if @comment.save + format.html { redirect_to @comment, notice: 'Comment was successfully created.' } + format.json { render json: @comment, status: :created, location: @comment } + else + format.html { render action: "new" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comments/1 + # PUT /comments/1.json + def update + @comment = Comment.find(params[:id]) + + respond_to do |format| + if @comment.update_attributes(params[:comment]) + format.html { redirect_to @comment, notice: 'Comment was successfully updated.' } + 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 + @comment = Comment.find(params[:id]) + @comment.destroy + + respond_to do |format| + format.html { redirect_to comments_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index a8636bd..7816feb 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -29,5 +29,17 @@ def contact # Método que define una acción vacía del controlador def ejemplo end - + + def author + end + # Método que define la acción búsqueda del controlador + def search + if params[:buscar].length >= 3 + @sites = Site.where("name like ? OR description like ?", "%#{params[:buscar]}%", "%#{params[:buscar]}%") + @trips = Trip.where("name like ? OR description like ?", "%#{params[:buscar]}%", "%#{params[:buscar]}%") + else + render action: "menosdetres" + end + end + end diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 57e0611..5638499 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -22,9 +22,11 @@ def index # GET /sites/1.json def show @site = Site.find(params[:id]) - + @comments = @site.comments.build + respond_to do |format| format.html # show.html.erb + format.js format.json { render json: @site } end end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..f21a38b 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -80,4 +80,13 @@ def destroy format.json { head :no_content } end end + + def ordered_index + @types = Type.order(:name) + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @types } + 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..00fb840 --- /dev/null +++ b/app/models/comment.rb @@ -0,0 +1,7 @@ +class Comment < ActiveRecord::Base + belongs_to :user + belongs_to :site + + validates :user_id, :presence => true + #attr_protected :user_id +end diff --git a/app/models/site.rb b/app/models/site.rb index 2b2f99a..e147387 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -3,8 +3,13 @@ class Site < ActiveRecord::Base belongs_to :user has_many :visits has_many :trips, :through => :visits - has_attached_file :image - + has_attached_file :image, + :styles => { + :thumb => "50x50", + :small => "150x150", + :medium => "200x200" + } + has_many :comments # Debe estar protegido para evitar accesos indeseados attr_protected :user_id diff --git a/app/models/user.rb b/app/models/user.rb index 35b8159..6d15d11 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,7 @@ 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/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb new file mode 100644 index 0000000..b3d6c2e --- /dev/null +++ b/app/views/comments/_comment.html.erb @@ -0,0 +1,22 @@ +
+ + + + + + + <% end %> +
+
+
<%= comment.user_id %>
+

<%= 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/_form.html.erb b/app/views/comments/_form.html.erb new file mode 100644 index 0000000..1a770cd --- /dev/null +++ b/app/views/comments/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@comment) do |f| %> + <% if @comment.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= f.label :coment %>
+ <%= f.text_field :coment %> +
+
+ <%= f.label :user_id, :hidden => true %> + <%= f.number_field :user_id, :value => current_user.id, :hidden => true %> +
+
+ <%= f.label :site_id, :hidden => true %> + <%= f.number_field :site_id, :hidden => true %> +
+
+ <%= 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..1276b36 --- /dev/null +++ b/app/views/comments/edit.html.erb @@ -0,0 +1,6 @@ +

Editing comment

+ +<%= render 'form' %> + +<%= link_to 'Show', @comment %> | +<%= link_to 'Back', site_path(@comment.site) %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb new file mode 100644 index 0000000..324cccf --- /dev/null +++ b/app/views/comments/index.html.erb @@ -0,0 +1,29 @@ +

Listing comments

+ + + + + + + + + + + +<% @comments.each do |comment| %> + + + + + + <% if comment.user == current_user %> + + + <% end %> + +<% end %> +
ComentUserSite
<%= comment.coment %><%= comment.user_id %><%= comment.site_id %><%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>
+ +
+ + 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..4625530 --- /dev/null +++ b/app/views/comments/show.html.erb @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Coment: + <%= @comment.coment %> +

+ +

+ User: + <%= @comment.user_id %> +

+ +

+ Site: + <%= @comment.site_id %> +

+ + +<%= link_to 'Edit', edit_comment_path(@comment) %> | +<%= link_to 'Back', site_path(@comment.site) %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e4c9e36..3fc9b27 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,7 +18,14 @@ - \ No newline at end of file + diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb new file mode 100644 index 0000000..f8cfb3e --- /dev/null +++ b/app/views/planet/author.html.erb @@ -0,0 +1,16 @@ +

Author

+ +

+<%= image_tag('fran.jpg') %>
+Name: Francisco Ayala Serrano
+Address: Calle Falsa 123, 28001 Madrid
+e-mail
+Curriculum: estudiante de Ingeniería de Telecomunicación. +

+

+<%= image_tag('mandi.png') %>
+Name: Jose Francisco Barea López
+Address: Calle Falsa 123, 28001 Madrid
+e-mail
+Curriculum: estudiante de Ingeniería de Telecomunicación y pensador. +

diff --git a/app/views/planet/menosdetres.html b/app/views/planet/menosdetres.html new file mode 100644 index 0000000..66ddad0 --- /dev/null +++ b/app/views/planet/menosdetres.html @@ -0,0 +1,3 @@ + + Introduce tres o más caracteres para realizar una búsqueda + diff --git a/app/views/planet/seaafdafrch.html.erb b/app/views/planet/seaafdafrch.html.erb new file mode 100644 index 0000000..7aa6428 --- /dev/null +++ b/app/views/planet/seaafdafrch.html.erb @@ -0,0 +1,5 @@ + + +
+ <%= render @sites %> + diff --git a/app/views/planet/search.html.erb b/app/views/planet/search.html.erb new file mode 100644 index 0000000..3fe7527 --- /dev/null +++ b/app/views/planet/search.html.erb @@ -0,0 +1,51 @@ + +
+ <% if !@sites.empty? %> +

Sitios encontrados

+ + <% @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 %>
+ <%= link_to 'Destroy', site, + :confirm => 'Are you sure?', + :method => :delete if site.user == current_user %> + +
+ <% end %> + <% if !@trips.empty? %> +

Viajes encontrados

+ + <% @trips.each do |trip| %> + + + + + <% end %> +
+
+
<%=link_to(trip.name, trip) %>
+
<%= truncate(strip_tags(trip.description), :length => 80) %>
+
+
+ <%= link_to 'Show', trip %>
+ <%= link_to 'Destroy', trip, + :confirm => 'Are you sure?', + :method => :delete if trip.user == current_user %> + +
+ <% end %> + <%= "No se ha encontrado nada" if (@sites.empty? && @trips.empty?) %> +
diff --git a/app/views/sites/_form.html.erb b/app/views/sites/_form.html.erb index f1fd754..6b58f07 100644 --- a/app/views/sites/_form.html.erb +++ b/app/views/sites/_form.html.erb @@ -10,6 +10,8 @@
<% end %> + +
<%= f.label :name %>
@@ -27,6 +29,26 @@ <%= f.label :image %>
<%= f.file_field :image %>
+
+ + <%= f.label :latitud %> + <%= f.text_field :latitud, :id => "lat" %>
+ <%= f.label :longitud %> + <%= f.text_field :longitud, :id => "long" %>
+ <%= f.label :zoom %> + <%= f.text_field :zoom, :value => "15" %> +
<%= f.submit %>
diff --git a/app/views/sites/_geo.html b/app/views/sites/_geo.html new file mode 100644 index 0000000..5542587 --- /dev/null +++ b/app/views/sites/_geo.html @@ -0,0 +1,43 @@ + +
+ + + + + + + + +
+ +
+ diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb index b8e4cae..14eebc4 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -19,11 +19,17 @@ <%= link_to 'Show', site %>
- <% if site.user == current_user %> <%= link_to 'Edit', edit_site_path(site) %>
+ Inclusiones: <%= site.visits.length %>
+ <% if site.user == current_user %> + <%= link_to 'Edit', edit_site_path(site) %>
<%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %> - <% end %> + <% end %>
+ <% if site.comments.exists? %> + <%= link_to 'Comentarios', site_comments_path(site) %> + <% end %> + <% end %> @@ -31,4 +37,4 @@
-<%= 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/show.html.erb b/app/views/sites/show.html.erb index 01a5417..0b5a408 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -1,19 +1,49 @@ + +
- +

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

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

<%= @site.name %>

<%=sanitize @site.description %>

- -

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

+ +

Localización

+
+ <%= render "geo" %> +
+ +

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

+
+

Comentarios

+ <% if @site.comments.exists? %> + <%= render @site.comments %> + <% end %> + +

Añadir un comentario:

+ <% if current_user %> + <%= form_for @comments do |f| %> + <%= f.number_field :site_id, :value => @site.id, :hidden => true %> + <%= f.number_field :user_id, :value => current_user.id, :hidden => true %> + <%= f.text_field :coment %>
+ <%= f.submit "Añadir comentario" %> + <% end %> + <% else %> + <%= link_to "Ingrese", new_user_session_path %> para comentar: + <% end %>
- Visitas: <%= @site.visitas %> + Visitas: <%= @site.visitas %>
+ Inclusiones: <%= @site.visits.length %>

-<% 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/trips/_geo.html b/app/views/trips/_geo.html new file mode 100644 index 0000000..bf5a07d --- /dev/null +++ b/app/views/trips/_geo.html @@ -0,0 +1,44 @@ + +

+ + + + + + + + +
+ +
+ diff --git a/app/views/trips/show.html.erb b/app/views/trips/show.html.erb index 8bced6a..130818e 100644 --- a/app/views/trips/show.html.erb +++ b/app/views/trips/show.html.erb @@ -1,28 +1 @@ -

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 %> - \ No newline at end of file +

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 %> \ No newline at end of file diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index e761359..67a56b6 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -23,7 +23,7 @@ <% end %> -
+
diff --git a/app/views/types/ordered_index.html.erb b/app/views/types/ordered_index.html.erb new file mode 100644 index 0000000..8e08eef --- /dev/null +++ b/app/views/types/ordered_index.html.erb @@ -0,0 +1,27 @@ +

Listing types

+ + + + + + + + + + + +<% @types.each do |type| %> + + + + + + + + +<% end %> +
NameDescriptionLast Modified
<%= type.name %><%= 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..79a748c 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -10,6 +10,10 @@ <%= @type.description %>

+

+ Last Modified: + <%= @type.updated_at %> +

<%= link_to 'Edit', edit_type_path(@type) %> | <%= link_to 'Back', types_path %> diff --git a/config/routes.rb b/config/routes.rb index 29d3c86..b20f84b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,12 +1,18 @@ Planet::Application.routes.draw do + + + resources :comments + resources :visits resources :trips devise_for :users - resources :sites + resources :sites do + resources :comments + end resources :types do # Rutas anidadas /types/id/sites..., resources :sites, :only => [ :index ] # Restringe a acción “index” @@ -17,6 +23,17 @@ get "planet/contact" get "planet/ejemplo" + + get "planet/author" + + get "types/index" + + get "types/ordered_index" + + get "planet/search" + + + #resources :types # The priority is based upon order of creation: # first created -> highest priority. diff --git a/db/migrate/20120415104000_create_comments.rb b/db/migrate/20120415104000_create_comments.rb new file mode 100644 index 0000000..b2c7aee --- /dev/null +++ b/db/migrate/20120415104000_create_comments.rb @@ -0,0 +1,11 @@ +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/20120418160224_add_geo_to_sites.rb b/db/migrate/20120418160224_add_geo_to_sites.rb new file mode 100644 index 0000000..962ba94 --- /dev/null +++ b/db/migrate/20120418160224_add_geo_to_sites.rb @@ -0,0 +1,10 @@ +class AddGeoToSites < ActiveRecord::Migration + def change + add_column :sites, :longitud, :float + + add_column :sites, :latitud, :float + + add_column :sites, :zoom, :integer + + end +end diff --git a/db/schema.rb b/db/schema.rb index e6aa66f..5f47b28 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,15 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120411160519) do +ActiveRecord::Schema.define(:version => 20120418160224) 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" @@ -26,6 +34,9 @@ t.string "image_file_size" t.datetime "image_updated_at" t.integer "visitas", :default => 0 + t.float "longitud" + t.float "latitud" + t.integer "zoom" end create_table "trips", :force => true do |t| diff --git a/doc/app/ApplicationController.html b/doc/app/ApplicationController.html index 65ef712..0138304 100644 --- a/doc/app/ApplicationController.html +++ b/doc/app/ApplicationController.html @@ -64,7 +64,17 @@

Parent

+ + +
@@ -87,6 +97,12 @@

Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -144,6 +160,41 @@

    class ApplicationController

    +
    +

    Public Instance Methods

    + + +
    + +
    + doc() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/application_controller.rb, line 4
    +def doc
    +end
    +
    + +
    + + + + +
    + + +
    +
  • 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..d98420f --- /dev/null +++ b/doc/app/CommentsController.html @@ -0,0 +1,446 @@ + + + + + + +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 46
    +def create
    +  @comment = Comment.new(params[:comment])
    +
    +  respond_to do |format|
    +    if @comment.save
    +      format.html { redirect_to @comment, notice: 'Comment was successfully created.' }
    +      format.json { render json: @comment, status: :created, location: @comment }
    +    else
    +      format.html { render action: "new" }
    +      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 78
    +def destroy
    +  @comment = Comment.find(params[:id])
    +  @comment.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to comments_url }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /comments/1/edit

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

    GET /comments GET /comments.json

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

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

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 30
    +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 19
    +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 62
    +def update
    +  @comment = Comment.find(params[:id])
    +
    +  respond_to do |format|
    +    if @comment.update_attributes(params[:comment])
    +      format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }
    +      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..121eb8a 100644 --- a/doc/app/PlanetController.html +++ b/doc/app/PlanetController.html @@ -70,12 +70,16 @@

    Methods

    @@ -101,6 +105,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -198,6 +208,35 @@

    Algunos comandos de formateo

    Public Instance Methods

    +
    + +
    + author() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/planet_controller.rb, line 33
    +def author
    +end
    +
    + +
    + + + + +
    + +
    @@ -214,7 +253,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 +282,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 +311,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 +324,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..ab1c7bb 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,7 +192,7 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 50
    +            
    # File app/controllers/sites_controller.rb, line 52
     def create
       @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user
       
    @@ -226,7 +232,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 82
    +            
    # File app/controllers/sites_controller.rb, line 84
     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 46
     def edit
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user
     end
    @@ -330,7 +336,7 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 34
    +            
    # File app/controllers/sites_controller.rb, line 36
     def new
       @site = current_user.sites.build # crea sitio vacio asociado a current_user
       
    @@ -368,9 +374,11 @@ 

    Public Instance Methods

    # File app/controllers/sites_controller.rb, line 23
     def show
       @site = Site.find(params[:id])
    -
    +              @comments = @site.comments.build
    +              
       respond_to do |format|
         format.html # show.html.erb
    +    format.js
         format.json { render json: @site }
       end
     end
    @@ -400,7 +408,7 @@

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 66
    +            
    # File app/controllers/sites_controller.rb, line 68
     def update
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user 
       
    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..476c01b 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 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..810ad1f 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,41 @@

    Public Instance Methods

  • +
    + +
    + ordered_index() + click to toggle source +
    + + +
    + + + + + +
    +
    # File app/controllers/types_controller.rb, line 84
    +def ordered_index
    +      @types = Type.order(:name)
    +
    +  respond_to do |format|
    +    format.html # index.html.erb
    +    format.json { render json: @types }
    +  end
    +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..de13979 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 22:55:26 +0200 +doc/README_FOR_APP Tue, 20 Mar 2012 19:07:24 +0100 +app/controllers/application_controller.rb Wed, 25 Apr 2012 22:24:11 +0200 +app/controllers/comments_controller.rb Wed, 25 Apr 2012 20:38:09 +0200 +app/controllers/planet_controller.rb Wed, 25 Apr 2012 22:32:37 +0200 +app/controllers/sites_controller.rb Wed, 25 Apr 2012 20:42:38 +0200 +app/controllers/trips_controller.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/controllers/types_controller.rb Sun, 25 Mar 2012 19:18:11 +0200 +app/controllers/visits_controller.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/helpers/application_helper.rb Tue, 20 Mar 2012 19:07:24 +0100 +app/helpers/comments_helper.rb Sun, 15 Apr 2012 12:40:00 +0200 +app/helpers/planet_helper.rb Tue, 20 Mar 2012 19:07:24 +0100 +app/helpers/sites_helper.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/helpers/trips_helper.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/helpers/types_helper.rb Tue, 20 Mar 2012 19:07:24 +0100 +app/helpers/visits_helper.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/models/comment.rb Wed, 25 Apr 2012 20:40:41 +0200 +app/models/site.rb Fri, 20 Apr 2012 16:28:00 +0200 +app/models/trip.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/models/type.rb Sun, 15 Apr 2012 11:30:41 +0200 +app/models/user.rb Sun, 15 Apr 2012 12:44:28 +0200 +app/models/visit.rb Sun, 15 Apr 2012 11:30:41 +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/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..aab3de1 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","author()","contact()","create()","create()","create()","create()","create()","destroy()","destroy()","destroy()","destroy()","destroy()","doc()","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#author()","planetcontroller#contact()","commentscontroller#create()","sitescontroller#create()","tripscontroller#create()","typescontroller#create()","visitscontroller#create()","commentscontroller#destroy()","sitescontroller#destroy()","tripscontroller#destroy()","typescontroller#destroy()","visitscontroller#destroy()","applicationcontroller#doc()","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","",""],["author","PlanetController","PlanetController.html#method-i-author","()",""],["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"],["doc","ApplicationController","ApplicationController.html#method-i-doc","()",""],["edit","CommentsController","CommentsController.html#method-i-edit","()","

    GET /comments/1/edit\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","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","()","

    Método que define la acción búsqueda del controlador\n"],["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..c3f197b 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 @@ -95,64 +104,86 @@

    Classes/Modules

    Methods