diff --git a/Gemfile.lock b/Gemfile.lock index fd905dc..53fc807 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,7 +60,7 @@ GEM 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) @@ -95,7 +95,7 @@ GEM rake (0.9.2.2) rdoc (3.12) json (~> 1.4) - sass (3.1.15) + sass (3.1.16) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) @@ -104,7 +104,7 @@ GEM hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.5) + sqlite3 (1.3.6) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) diff --git a/app/assets/images/foto.jpg b/app/assets/images/foto.jpg new file mode 100755 index 0000000..60f27f1 Binary files /dev/null and b/app/assets/images/foto.jpg differ diff --git a/app/assets/javascripts/comentarios.js.coffee b/app/assets/javascripts/comentarios.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/comentarios.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/comentarios.css.scss b/app/assets/stylesheets/comentarios.css.scss new file mode 100644 index 0000000..494c101 --- /dev/null +++ b/app/assets/stylesheets/comentarios.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the comentarios 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/comentarios_controller.rb b/app/controllers/comentarios_controller.rb new file mode 100644 index 0000000..9ae7666 --- /dev/null +++ b/app/controllers/comentarios_controller.rb @@ -0,0 +1,83 @@ +class ComentariosController < ApplicationController + # GET /comentarios + # GET /comentarios.json + def index + @comentarios = Comentario.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @comentarios } + end + end + + # GET /comentarios/1 + # GET /comentarios/1.json + def show + @comentario = Comentario.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @comentario } + end + end + + # GET /comentarios/new + # GET /comentarios/new.json + def new + @comentario = Comentario.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @comentario } + end + end + + # GET /comentarios/1/edit + def edit + @comentario = Comentario.find(params[:id]) + end + + # POST /comentarios + # POST /comentarios.json + def create + @comentario = Comentario.new(params[:comentario]) + + respond_to do |format| + if @comentario.save + format.html { redirect_to @comentario, notice: 'Comentario was successfully created.' } + format.json { render json: @comentario, status: :created, location: @comentario } + else + format.html { render action: "new" } + format.json { render json: @comentario.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comentarios/1 + # PUT /comentarios/1.json + def update + @comentario = Comentario.find(params[:id]) + + respond_to do |format| + if @comentario.update_attributes(params[:comentario]) + format.html { redirect_to @comentario, notice: 'Comentario was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comentario.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /comentarios/1 + # DELETE /comentarios/1.json + def destroy + @comentario = Comentario.find(params[:id]) + @comentario.destroy + + respond_to do |format| + format.html { redirect_to comentarios_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..c98ce96 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -30,4 +30,17 @@ def contact def ejemplo end + def author + end + + def search + if params[:q].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: "menosdetres" + end + end + + end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ new file mode 100644 index 0000000..9637e74 --- /dev/null +++ b/app/controllers/planet_controller.rb~ @@ -0,0 +1,37 @@ +# 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 author + end + + +end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..2186e4e 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -10,6 +10,18 @@ def index end 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: @type } + end + + end + # GET /types/1 # GET /types/1.json def show @@ -21,6 +33,8 @@ def show end end + + # GET /types/new # GET /types/new.json def new diff --git a/app/controllers/types_controller.rb~ b/app/controllers/types_controller.rb~ new file mode 100644 index 0000000..7c668e6 --- /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/ordered_index + # GET /types/ordered_index.json + def ordered_index + @type = Type.find(:all,:order => :name) + + respond_to do |format| + format.html # ordered_index.html.erb + format.json { render json: @type } + 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 +end diff --git a/app/helpers/comentarios_helper.rb b/app/helpers/comentarios_helper.rb new file mode 100644 index 0000000..a8f928b --- /dev/null +++ b/app/helpers/comentarios_helper.rb @@ -0,0 +1,2 @@ +module ComentariosHelper +end diff --git a/app/models/comentario.rb b/app/models/comentario.rb new file mode 100644 index 0000000..14d1412 --- /dev/null +++ b/app/models/comentario.rb @@ -0,0 +1,6 @@ +class Comentario < ActiveRecord::Base + +belongs_to :user +belongs_to :site + +end diff --git a/app/models/comentario.rb~ b/app/models/comentario.rb~ new file mode 100644 index 0000000..922c311 --- /dev/null +++ b/app/models/comentario.rb~ @@ -0,0 +1,6 @@ +class Comentario < ActiveRecord::Base + +belong_to :user +belong_to :site + +end diff --git a/app/models/site.rb b/app/models/site.rb index 2b2f99a..66b6428 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -2,6 +2,7 @@ class Site < ActiveRecord::Base belongs_to :type belongs_to :user has_many :visits + has_many :comentarios has_many :trips, :through => :visits has_attached_file :image diff --git a/app/models/site.rb~ b/app/models/site.rb~ new file mode 100644 index 0000000..66b6428 --- /dev/null +++ b/app/models/site.rb~ @@ -0,0 +1,15 @@ +class Site < ActiveRecord::Base + belongs_to :type + belongs_to :user + has_many :visits + has_many :comentarios + 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 diff --git a/app/models/user.rb b/app/models/user.rb index 35b8159..6b7d746 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,6 +2,8 @@ class User < ActiveRecord::Base has_many :sites has_many :trips + has_many :comentarios + # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable diff --git a/app/models/user.rb~ b/app/models/user.rb~ new file mode 100644 index 0000000..1a1d0f3 --- /dev/null +++ b/app/models/user.rb~ @@ -0,0 +1,17 @@ +class User < ActiveRecord::Base + + has_many :site + has_many :trips + has_many :comentarios + + + # 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/comentarios/_form.html.erb b/app/views/comentarios/_form.html.erb new file mode 100644 index 0000000..7f1faf7 --- /dev/null +++ b/app/views/comentarios/_form.html.erb @@ -0,0 +1,26 @@ +<%= form_for(@comentario) do |f| %> + <% if @comentario.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= f.label :coment %>
+ <%= f.text_area :coment, :maxlength => 240,:rows => 6 %> +
+ +
+ <%= f.label :site_id %>
+ <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/comentarios/_form.html.erb~ b/app/views/comentarios/_form.html.erb~ new file mode 100644 index 0000000..59a35a4 --- /dev/null +++ b/app/views/comentarios/_form.html.erb~ @@ -0,0 +1,29 @@ +<%= form_for(@comentario) do |f| %> + <% if @comentario.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= f.label :coment %>
+ <%= f.text_field :coment %> +
+
+ <%= f.label :user_id %>
+ <%= f.number_field :user_id %> +
+
+ <%= f.label :site_id %>
+ <%= f.number_field :site_id %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/comentarios/edit.html.erb b/app/views/comentarios/edit.html.erb new file mode 100644 index 0000000..9a8929b --- /dev/null +++ b/app/views/comentarios/edit.html.erb @@ -0,0 +1,6 @@ +

Editing comentario

+ +<%= render 'form' %> + +<%= link_to 'Show', @comentario %> | +<%= link_to 'Back', comentarios_path %> diff --git a/app/views/comentarios/index.html.erb b/app/views/comentarios/index.html.erb new file mode 100644 index 0000000..e10c106 --- /dev/null +++ b/app/views/comentarios/index.html.erb @@ -0,0 +1,32 @@ +
+

Listing Comentarios

+ + + +<% @comentarios.each do |comentario| %> + + + + + + + + +<% end %> +
<%= comentario.user.name if comentario.user %> +
+
<%= link_to comentario.site.name, comentario.site if comentario.site%>
+
<%= comentario.coment %>
+
+ <% if comentario.user == current_user %> + <%= link_to 'Edit', edit_comentario_path(comentario) %>
+ <%= link_to 'Destroy', comentario, confirm: 'Are you sure?', method: :delete %> + <% end %> +
+
+ +
+ +<%= link_to 'New Comentario', new_comentario_path %> +
+<%= link_to 'Volver', sites_path %> diff --git a/app/views/comentarios/index.html.erb~ b/app/views/comentarios/index.html.erb~ new file mode 100644 index 0000000..33f7998 --- /dev/null +++ b/app/views/comentarios/index.html.erb~ @@ -0,0 +1,27 @@ +

Listing comentarios

+ + + + + + + + + + + +<% @comentarios.each do |comentario| %> + + + + + + + + +<% end %> +
ComentUserSite
<%= comentario.coment %><%= comentario.user %><%= comentario.site %><%= link_to 'Show', comentario %><%= link_to 'Edit', edit_comentario_path(comentario) if comentario.user==current_user %><%= link_to 'Destroy', comentario, confirm: 'Are you sure?', method: :delete if comentario.user==current_user %>
+ +
+ +<%= link_to 'Añada su comentario', new_comentario_path %>
diff --git a/app/views/comentarios/new.html.erb b/app/views/comentarios/new.html.erb new file mode 100644 index 0000000..5310e0c --- /dev/null +++ b/app/views/comentarios/new.html.erb @@ -0,0 +1,5 @@ +

New comentario

+ +<%= render 'form' %> + +<%= link_to 'Back', comentarios_path %> diff --git a/app/views/comentarios/show.html.erb b/app/views/comentarios/show.html.erb new file mode 100644 index 0000000..bed947d --- /dev/null +++ b/app/views/comentarios/show.html.erb @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

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

+ +

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

+ +

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

+ + +<%= link_to 'Edit', edit_comentario_path(@comentario) %> | +<%= link_to 'Back', comentarios_path %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e4c9e36..2b57459 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,18 @@ - \ 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..e338c76 --- /dev/null +++ b/app/views/layouts/application.html.erb~ @@ -0,0 +1,73 @@ + + + + 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 "Sitios", sites_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Ejemplo", planet_ejemplo_path %>
+ <%= link_to "Author", planet_author_path %>
+ <%= link_to "Tipos_Ordenado", ordered_index_types_path %>
+ <%= link_to('/Documentacion/',)%>
+
+
+ <%= link_to "Home", planet_index_path %>
+ <%= link_to "Tipos", types_path %>
+ <%= link_to "Sitios", sites_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Ejemplo", planet_ejemplo_path %>
+ <%= link_to "Author", planet_author_path %>
+ <%= link_to "Tipos_Ordenado", ordered_index_types_path %>
+ <%= link_to "Viajes", trips_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Sign up", new_user_registration_path unless current_user %> +
+
+

<%= notice %>

<%= alert %>

+ + <%= yield %> + <%= link_to "Home", planet_index_path %>
+ <%= link_to "Tipos", types_path %>
+ <%= link_to "Sitios", sites_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Ejemplo", planet_ejemplo_path %>
+ <%= link_to "Author", planet_author_path %>
+ <%= link_to "Tipos_Ordenado", ordered_index_types_path %>
+ <%= link_to('/Documentacion/',)%>
+
+
+ + diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb new file mode 100644 index 0000000..30c4316 --- /dev/null +++ b/app/views/planet/author.html.erb @@ -0,0 +1 @@ +

Roberto Fuentes Martinez

Direccion postal:

Plaza Martinez Olmedilla, 8

28031 MADRID

Email: rfm_it@yahoo.es

<%= image_tag('foto.jpg') %>

Curriculum Vitae

Formación:

2005-Act Estudiante de Ing.Sup.Telecomunicacion ETSIT-UPM

Experiencia:

2011-Act Tecnocom

Analista Programador de aplicaciones con BBDD Oracle

\ 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..fd1ed74 --- /dev/null +++ b/app/views/planet/author.html.erb~ @@ -0,0 +1 @@ +<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %>

Roberto Fuentes Martinez

Direccion postal:

Plaza Martinez Olmedilla, 8

28031 MADRID

Email: rfm_it@yahoo.es

<%= image_tag('foto.jpg') %>

Curriculum Vitae

Formación:

2005-Act Estudiante de Ing.Sup.Telecomunicacion ETSIT-UPM

Experiencia:

2011-Act Tecnocom

Analista Programador de aplicaciones con BBDD Oracle

<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %> \ No newline at end of file diff --git a/app/views/planet/contact.html.erb b/app/views/planet/contact.html.erb index f339edd..676dde5 100644 --- a/app/views/planet/contact.html.erb +++ b/app/views/planet/contact.html.erb @@ -1 +1 @@ -

Contact Planet Travel Site

To contact us send us an email to:

contact@planet.travel.com

or call us at: 615 783 567

\ No newline at end of file +

Contact Planet Travel Site

To contact us send us an email to:

contact@planet.travel.com

or call us at: 615 783 567

\ No newline at end of file diff --git a/app/views/planet/contact.html.erb~ b/app/views/planet/contact.html.erb~ new file mode 100644 index 0000000..5291511 --- /dev/null +++ b/app/views/planet/contact.html.erb~ @@ -0,0 +1 @@ +<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %>

Contact Planet Travel Site

To contact us send us an email to:

contact@planet.travel.com

or call us at: 615 783 567

<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %> \ No newline at end of file diff --git a/app/views/planet/ejemplo.html.erb b/app/views/planet/ejemplo.html.erb index cb05eb9..924c5be 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 - -

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

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..06ebd15 --- /dev/null +++ b/app/views/planet/ejemplo.html.erb~ @@ -0,0 +1 @@ +<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %>

ERb: Extended Ruby

El formato ERb o .erb es HTML extendido con anotaciones Ruby, delimitadas por <% o <%= y %> , como en el siguiente ejemplo

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.

<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_index_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %> \ No newline at end of file diff --git a/app/views/planet/index.html.erb b/app/views/planet/index.html.erb index bbee722..e353909 100644 --- a/app/views/planet/index.html.erb +++ b/app/views/planet/index.html.erb @@ -1 +1 @@ -

Wecome to the Planet Travel Site

This site gathers information of touristic sites from all over the world and should help you to organize your trips and your holidays.

<%= image_tag('pedriza2-m.png') %>

Feel free to use it for your convenience and pleasure.

\ No newline at end of file +

Wecome to the Planet Travel Site

This site gathers information of touristic sites from all over the world and should help you to organize your trips and your holidays.

<%= image_tag('pedriza2-m.png') %>

Feel free to use it for your convenience and pleasure.

\ No newline at end of file diff --git a/app/views/planet/index.html.erb~ b/app/views/planet/index.html.erb~ new file mode 100644 index 0000000..33b0ece --- /dev/null +++ b/app/views/planet/index.html.erb~ @@ -0,0 +1 @@ +<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %>

Wecome to the Planet Travel Site

This site gathers information of touristic sites from all over the world and should help you to organize your trips and your holidays.

<%= image_tag('pedriza2-m.png') %>

Feel free to use it for your convenience and pleasure.

<%= link_to('Index', planet_index_path) %> <%= link_to('Contact', planet_contact_path) %> <%= link_to('Ejemplo', planet_ejemplo_path) %> <%= link_to('Author', planet_author_path) %> <%= link_to('Type/Index', types_path) %> <%= link_to('Type/OrderedIndex', ordered_index_types_path) %> \ No newline at end of file diff --git a/app/views/planet/menosdetres.html.erb b/app/views/planet/menosdetres.html.erb new file mode 100644 index 0000000..0226ff7 --- /dev/null +++ b/app/views/planet/menosdetres.html.erb @@ -0,0 +1 @@ +Error en busqueda> Debe introducir como minimo 3 caracteres
\ No newline at end of file diff --git a/app/views/planet/menosdetres.html.erb~ b/app/views/planet/menosdetres.html.erb~ new file mode 100644 index 0000000..48ab301 --- /dev/null +++ b/app/views/planet/menosdetres.html.erb~ @@ -0,0 +1 @@ +Error en busqueda> Debe introducir como minimo 3 caracteres \ 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..c1280dd --- /dev/null +++ b/app/views/planet/search.html.erb @@ -0,0 +1 @@ +

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) %>
<% if site.comentarios.empty? == false %> <%= link_to "Comentarios", comentarios_path %> <%end%>
<% if site.trips.size>0 %> Incluido en: <%= site.trips.size%> viajes
<% 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 %>

<%= @sites.length %><%=" Results found."%>

Viajes encontrados

<% if @trips %> <% @trips.each do |trip| %> <% end %> <% 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 %>
<%= @trips.length %><%=" Results found."%> \ 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..e353909 --- /dev/null +++ b/app/views/planet/search.html.erb~ @@ -0,0 +1 @@ +

Wecome to the Planet Travel Site

This site gathers information of touristic sites from all over the world and should help you to organize your trips and your holidays.

<%= image_tag('pedriza2-m.png') %>

Feel free to use it for your convenience and pleasure.

\ No newline at end of file diff --git a/app/views/sites/_form.html.erb b/app/views/sites/_form.html.erb old mode 100644 new mode 100755 index f1fd754..486e099 --- 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..f1fd754 --- /dev/null +++ b/app/views/sites/_form.html.erb? @@ -0,0 +1,33 @@ +<%= form_for(@site) do |f| %> + <% if @site.errors.any? %> +
+

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

+ + +
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :description %>
+ <%= f.text_area :description , :rows => 4 %> +
+
+ <%= f.label :type_id %>
+ <%= f.collection_select(:type_id, Type.find(:all, :order => :name), :id, :name) %> +
+
+ <%= f.label :image %>
+ <%= f.file_field :image %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/sites/_geo.html.erb b/app/views/sites/_geo.html.erb new file mode 100755 index 0000000..24c33a1 --- /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..0d7d6b9 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -6,7 +6,7 @@ - <%= link_to image_tag(site.image.url, :class => 'list_image'), site %> + <%= link_to image_tag(site.image_url, :class => 'list_image'), site %> @@ -14,21 +14,27 @@
<%= link_to site.name, site %>
<%= truncate(strip_tags(site.description), :length => 80) %>
+ <% if site.comentarios !=[] %> + 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..6d5d5f5 --- /dev/null +++ b/app/views/sites/index.html.erb~ @@ -0,0 +1,40 @@ +
+

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/ordered_index.html.erb b/app/views/sites/ordered_index.html.erb new file mode 100644 index 0000000..38197a3 --- /dev/null +++ b/app/views/sites/ordered_index.html.erb @@ -0,0 +1,47 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_path) %> + +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+ +
<%= type.updated_at %>
+
+
+ <%= link_to 'Show', type %>
+ <%= link_to 'Ordered_index', 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 %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_path) %> diff --git a/app/views/sites/search.html.erb b/app/views/sites/search.html.erb new file mode 100644 index 0000000..ffd8161 --- /dev/null +++ b/app/views/sites/search.html.erb @@ -0,0 +1,39 @@ +
+

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) %>
+
+
+ <%= 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 %> + <% if !site.comentarios.empty? %> + <%= link_to 'Comments', site_comentarios_path(params[:site_id] = site.id) if site.comentarios %> + <% end %> +
+
+ +
+ +<%= link_to 'New site', new_site_path %> diff --git a/app/views/sites/search.html.erb~ b/app/views/sites/search.html.erb~ new file mode 100644 index 0000000..0d7d6b9 --- /dev/null +++ b/app/views/sites/search.html.erb~ @@ -0,0 +1,40 @@ +
+

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.comentarios !=[] %> + 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..de417ee 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -1,19 +1,36 @@
-

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

+

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

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

<%= @site.name %>

+

<%= @site.name %>

<%=sanitize @site.description %>

-

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

-
+

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

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

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

+ +

<%= (link_to 'Ver comentarios', site_comentarios_path(@site.id)) if (@site.comentarios.size > 0) %>

+

<%= link_to 'Añadir Comentario', new_comentario_path %> + +

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

-<% 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..58b47ea --- /dev/null +++ b/app/views/sites/show.html.erb~ @@ -0,0 +1,28 @@ +

+ +

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

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

<%= @site.name %>

+ +

<%=sanitize @site.description %>

+ + +

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

+ +

<%= (link_to 'Ver comentarios', site_comentarios_path(@site.id)) if (@site.comentarios.size > 0) %>

+

<%= link_to 'Añadir Comentario', new_comentario_path %> + +


+ +
+ Visitas: <%= @site.visitas %> +
+ +

+<% if @site.user == current_user %> + <%= link_to 'Edit', edit_site_path(@site) %> | +<% end %> +<%= link_to 'Back', sites_path %> diff --git a/app/views/trips/show.html.erb b/app/views/trips/show.html.erb old mode 100644 new mode 100755 diff --git a/app/views/types/_form.html.erb b/app/views/types/_form.html.erb index 80284dd..c77c26d 100644 --- a/app/views/types/_form.html.erb +++ b/app/views/types/_form.html.erb @@ -1,3 +1,5 @@ + + <%= form_for(@type) do |f| %> <% if @type.errors.any? %>

@@ -23,3 +25,5 @@ <%= f.submit %>
<% end %> + + diff --git a/app/views/types/_form.html.erb~ b/app/views/types/_form.html.erb~ new file mode 100644 index 0000000..e0ba2b7 --- /dev/null +++ b/app/views/types/_form.html.erb~ @@ -0,0 +1,39 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> + +<%= form_for(@type) do |f| %> + <% if @type.errors.any? %> +
+

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

+ +
    + <% @type.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :description %>
+ <%= f.text_area :description %> +
+
+ <%= f.submit %> +
+<% end %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> diff --git a/app/views/types/edit.html.erb b/app/views/types/edit.html.erb index fa73e65..6b85503 100644 --- a/app/views/types/edit.html.erb +++ b/app/views/types/edit.html.erb @@ -4,3 +4,5 @@ <%= link_to 'Show', @type %> | <%= link_to 'Back', types_path %> + + diff --git a/app/views/types/edit.html.erb~ b/app/views/types/edit.html.erb~ new file mode 100644 index 0000000..4bf95b8 --- /dev/null +++ b/app/views/types/edit.html.erb~ @@ -0,0 +1,20 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> + +

Editing type

+ +<%= render 'form' %> + +<%= link_to 'Show', @type %> | +<%= link_to 'Back', types_path %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index e761359..679fe0a 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -1,3 +1,4 @@ +

Listing Types

@@ -10,11 +11,13 @@
<%= link_to type.name, type_sites_path(type) %>
<%= truncate(strip_tags(type.description), :length => 80) %>
+ +
<%= type.updated_at %>
- <%= link_to 'Show', type %>
+ <%= link_to 'Show', type %>
<%= link_to 'Edit', edit_type_path(type) %>
<%= link_to 'Destroy', type, :confirm => 'Are you sure?', @@ -28,3 +31,5 @@
<%= link_to 'New Type', new_type_path %> + + diff --git a/app/views/types/index.html.erb~ b/app/views/types/index.html.erb~ new file mode 100644 index 0000000..49a74ea --- /dev/null +++ b/app/views/types/index.html.erb~ @@ -0,0 +1,36 @@ + +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+ +
<%= type.updated_at %>
+
+
+ <%= link_to 'Show', type %>
+ <%= link_to 'Ordered_index', 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/new.html.erb b/app/views/types/new.html.erb index 0670946..3360843 100644 --- a/app/views/types/new.html.erb +++ b/app/views/types/new.html.erb @@ -1,5 +1,9 @@ + +

New type

<%= render 'form' %> <%= link_to 'Back', types_path %> + + diff --git a/app/views/types/new.html.erb~ b/app/views/types/new.html.erb~ new file mode 100644 index 0000000..fe36ba1 --- /dev/null +++ b/app/views/types/new.html.erb~ @@ -0,0 +1,19 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> + +

New type

+ +<%= render 'form' %> + +<%= link_to 'Back', types_path %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> diff --git a/app/views/types/ordered_index.erb b/app/views/types/ordered_index.erb new file mode 100644 index 0000000..17574ae --- /dev/null +++ b/app/views/types/ordered_index.erb @@ -0,0 +1,46 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_path) %> + +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+ +
<%= 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 %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_path) %> diff --git a/app/views/types/ordered_index.erb~ b/app/views/types/ordered_index.erb~ new file mode 100644 index 0000000..1e71bb7 --- /dev/null +++ b/app/views/types/ordered_index.erb~ @@ -0,0 +1,33 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_path) %> + +

<%= notice %>

+ +

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

+ +

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

+ +

+ Updated At: + <%= @type.updated_at %> +

+ +<%= link_to 'Edit', edit_type_path(@type) %> | +<%= link_to 'Back', types_path %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', types_ordered_index_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..a3e28e9 --- /dev/null +++ b/app/views/types/ordered_index.html.erb @@ -0,0 +1,33 @@ +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+ +
<%= 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..4ecfc55 --- /dev/null +++ b/app/views/types/ordered_index.html.erb~ @@ -0,0 +1,34 @@ +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+ +
<%= type.updated_at %>
+
+
+ <%= link_to 'Show', type %>
+ <%= link_to 'Ordered_index', 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..04648de 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -10,6 +10,12 @@ <%= @type.description %>

+

+ Updated At: + <%= @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..c2cd7e1 --- /dev/null +++ b/app/views/types/show.html.erb~ @@ -0,0 +1,33 @@ +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> + +

<%= notice %>

+ +

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

+ +

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

+ +

+ Updated At: + <%= @type.updated_at %> +

+ +<%= link_to 'Edit', edit_type_path(@type) %> | +<%= link_to 'Back', types_path %> + +<%= link_to('Index', planet_index_path) %> +<%= link_to('Contact', planet_contact_path) %> +<%= link_to('Ejemplo', planet_ejemplo_path) %> +<%= link_to('Author', planet_author_path) %> +<%= link_to('Type/Index', types_index_path) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> diff --git a/config/routes.rb b/config/routes.rb index 29d3c86..0658590 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,23 +1,57 @@ Planet::Application.routes.draw do + + + + resources :comentarios + resources :visits resources :trips devise_for :users - resources :sites + resources :sites do + resources :comentarios + end + + + + resources :types do # Rutas anidadas /types/id/sites..., + + + resources :sites, :only => [ :index ] # Restringe a acción “index” - end + collection do + get "ordered_index" + + end + + + + end + + + get "planet/index" get "planet/contact" get "planet/ejemplo" + get "planet/author" + + get "planet/search" + + get "doc/app" + + + + + # The priority is based upon order of creation: # first created -> highest priority. diff --git a/config/routes.rb~ b/config/routes.rb~ new file mode 100644 index 0000000..0faf1e4 --- /dev/null +++ b/config/routes.rb~ @@ -0,0 +1,111 @@ +Planet::Application.routes.draw do + + + + + resources :comentarios + + resources :visits + + resources :trips + + devise_for :users + + resources :sites do + resources :comentarios + end + + + + + + resources :types do # Rutas anidadas /types/id/sites..., + + + + resources :sites, :only => [ :index ] # Restringe a acción “index” + + collection do + get "ordered_index" + + end + + + + end + + + + get "planet/index" + + get "planet/contact" + + get "planet/ejemplo" + + get "planet/author" + + get "planet/search" + + + + + + # 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/20120320100145_create_sites.rb index 823209a..f2bebbe 100644 --- a/db/migrate/20120320100145_create_sites.rb +++ b/db/migrate/20120320100145_create_sites.rb @@ -5,7 +5,7 @@ def change t.text :description t.integer :type_id t.string :image_url - + t.timestamps end end diff --git a/db/migrate/20120320100145_create_sites.rb~ b/db/migrate/20120320100145_create_sites.rb~ new file mode 100644 index 0000000..0787b89 --- /dev/null +++ b/db/migrate/20120320100145_create_sites.rb~ @@ -0,0 +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.float :longitud + t.float :latitud + t.integer :zoom + t.timestamps + end + end +end diff --git a/db/migrate/20120415163917_create_comentarios.rb b/db/migrate/20120415163917_create_comentarios.rb new file mode 100644 index 0000000..1f46d24 --- /dev/null +++ b/db/migrate/20120415163917_create_comentarios.rb @@ -0,0 +1,11 @@ +class CreateComentarios < ActiveRecord::Migration + def change + create_table :comentarios do |t| + t.string :coment + t.integer :user_id + t.integer :site_id + + t.timestamps + end + end +end diff --git a/db/migrate/20120422170530_addlongitud_tosites.rb b/db/migrate/20120422170530_addlongitud_tosites.rb new file mode 100644 index 0000000..f557f9a --- /dev/null +++ b/db/migrate/20120422170530_addlongitud_tosites.rb @@ -0,0 +1,16 @@ +class AddlongitudTosites < ActiveRecord::Migration + def up + + add_column :sites, :longitud, :float + add_column :sites, :latitud, :float + add_column :sites, :zoom, :integer + + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422170530_addlongitud_tosites.rb~ b/db/migrate/20120422170530_addlongitud_tosites.rb~ new file mode 100644 index 0000000..563b711 --- /dev/null +++ b/db/migrate/20120422170530_addlongitud_tosites.rb~ @@ -0,0 +1,16 @@ +class AddlongitudTosites < ActiveRecord::Migration + def up + + add_column :sites, :longitud, :float + add_column :sites, :latitud, :float + add_column :sites, :zoom, :zoom + + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422170605_addlatitud_tosites.rb b/db/migrate/20120422170605_addlatitud_tosites.rb new file mode 100644 index 0000000..1ac5867 --- /dev/null +++ b/db/migrate/20120422170605_addlatitud_tosites.rb @@ -0,0 +1,7 @@ +class AddlatitudTosites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120422170639_addzoom_tosites.rb b/db/migrate/20120422170639_addzoom_tosites.rb new file mode 100644 index 0000000..93297d2 --- /dev/null +++ b/db/migrate/20120422170639_addzoom_tosites.rb @@ -0,0 +1,7 @@ +class AddzoomTosites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120422173317_addcampos_tosites.rb b/db/migrate/20120422173317_addcampos_tosites.rb new file mode 100644 index 0000000..50598f2 --- /dev/null +++ b/db/migrate/20120422173317_addcampos_tosites.rb @@ -0,0 +1,16 @@ +class AddcamposTosites < ActiveRecord::Migration + def up + + add_column :sites, :longitud, :float + add_column :sites, :latitud, :float + add_column :sites, :zoom, :integer + + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422173317_addcampos_tosites.rb~ b/db/migrate/20120422173317_addcampos_tosites.rb~ new file mode 100644 index 0000000..9e15e07 --- /dev/null +++ b/db/migrate/20120422173317_addcampos_tosites.rb~ @@ -0,0 +1,16 @@ +class AddcamposTosites < ActiveRecord::Migration + def up + + add_column :sites, :longitud, :float + add_column :sites, :latitud, :float + add_column :sites, :zoom, :zoom + + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422173528_addlonglatzoom_tosites.rb b/db/migrate/20120422173528_addlonglatzoom_tosites.rb new file mode 100644 index 0000000..aed7c19 --- /dev/null +++ b/db/migrate/20120422173528_addlonglatzoom_tosites.rb @@ -0,0 +1,16 @@ +class AddlonglatzoomTosites < ActiveRecord::Migration + def up + + add_column :sites, :longitud, :float + add_column :sites, :latitud, :float + add_column :sites, :zoom, :integer + + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422173528_addlonglatzoom_tosites.rb~ b/db/migrate/20120422173528_addlonglatzoom_tosites.rb~ new file mode 100644 index 0000000..ca0d27c --- /dev/null +++ b/db/migrate/20120422173528_addlonglatzoom_tosites.rb~ @@ -0,0 +1,7 @@ +class AddlonglatzoomTosites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120422173703_addnewzoom_tosites.rb b/db/migrate/20120422173703_addnewzoom_tosites.rb new file mode 100644 index 0000000..c6b7e36 --- /dev/null +++ b/db/migrate/20120422173703_addnewzoom_tosites.rb @@ -0,0 +1,9 @@ +class AddnewzoomTosites < ActiveRecord::Migration + def up + add_column :sites, :zoom, :integer + end + + def down + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422173703_addnewzoom_tosites.rb~ b/db/migrate/20120422173703_addnewzoom_tosites.rb~ new file mode 100644 index 0000000..830334e --- /dev/null +++ b/db/migrate/20120422173703_addnewzoom_tosites.rb~ @@ -0,0 +1,7 @@ +class AddnewzoomTosites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120422182402_changezoom_tosites.rb b/db/migrate/20120422182402_changezoom_tosites.rb new file mode 100644 index 0000000..61ab7ec --- /dev/null +++ b/db/migrate/20120422182402_changezoom_tosites.rb @@ -0,0 +1,7 @@ +class ChangezoomTosites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/migrate/20120422184508_deletenuevas_to_sites.rb b/db/migrate/20120422184508_deletenuevas_to_sites.rb new file mode 100644 index 0000000..bd73125 --- /dev/null +++ b/db/migrate/20120422184508_deletenuevas_to_sites.rb @@ -0,0 +1,11 @@ +class DeletenuevasToSites < ActiveRecord::Migration + def up + end + + def down + + remove_column :sites, :longitud + remove_column :sites, :latitud + remove_column :sites, :zoom + end +end diff --git a/db/migrate/20120422184508_deletenuevas_to_sites.rb~ b/db/migrate/20120422184508_deletenuevas_to_sites.rb~ new file mode 100644 index 0000000..e85e0f3 --- /dev/null +++ b/db/migrate/20120422184508_deletenuevas_to_sites.rb~ @@ -0,0 +1,7 @@ +class DeletenuevasToSites < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index e6aa66f..b6c1275 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,23 +11,19 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120411160519) do +ActiveRecord::Schema.define(:version => 20120422173317) do - create_table "sites", :force => true do |t| - t.string "name" - t.text "description" - t.integer "type_id" - t.string "image_url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "comentarios", :force => true do |t| + t.string "coment" 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 + t.integer "site_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end +# Could not dump table "sites" because of following StandardError +# Unknown type 'zoom' for column 'zoom' + create_table "trips", :force => true do |t| t.string "name" t.text "description" diff --git a/doc/app/ApplicationController.html b/doc/app/ApplicationController.html index 65ef712..04bd7c9 100644 --- a/doc/app/ApplicationController.html +++ b/doc/app/ApplicationController.html @@ -87,6 +87,12 @@

Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/ApplicationHelper.html b/doc/app/ApplicationHelper.html index efcf78f..256ce6c 100644 --- a/doc/app/ApplicationHelper.html +++ b/doc/app/ApplicationHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

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

    class Comentario

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

    class ComentariosController

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

    Public Instance Methods

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

    POST /comentarios POST /comentarios.json

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

    DELETE /comentarios/1 DELETE /comentarios/1.json

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

    GET /comentarios/1/edit

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

    GET /comentarios GET /comentarios.json

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

    GET /comentarios/new GET /comentarios/new.json

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

    GET /comentarios/1 GET /comentarios/1.json

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

    PUT /comentarios/1 PUT /comentarios/1.json

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

    module ComentariosHelper

    + +
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/doc/app/PlanetController.html b/doc/app/PlanetController.html index e3bde99..04a3199 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 +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • 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..2dee8a8 100644 --- a/doc/app/PlanetHelper.html +++ b/doc/app/PlanetHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Site.html b/doc/app/Site.html index 3c8b96c..cde7c35 100644 --- a/doc/app/Site.html +++ b/doc/app/Site.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/SitesController.html b/doc/app/SitesController.html index c02b5c6..f5d0f8c 100644 --- a/doc/app/SitesController.html +++ b/doc/app/SitesController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/SitesHelper.html b/doc/app/SitesHelper.html index aa932c6..146bf3e 100644 --- a/doc/app/SitesHelper.html +++ b/doc/app/SitesHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Trip.html b/doc/app/Trip.html index 9a51e94..6d52587 100644 --- a/doc/app/Trip.html +++ b/doc/app/Trip.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/TripsController.html b/doc/app/TripsController.html index abfde19..7ac1c22 100644 --- a/doc/app/TripsController.html +++ b/doc/app/TripsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/TripsHelper.html b/doc/app/TripsHelper.html index 7d08398..b79e648 100644 --- a/doc/app/TripsHelper.html +++ b/doc/app/TripsHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Type.html b/doc/app/Type.html index c9f3a24..42b6837 100644 --- a/doc/app/Type.html +++ b/doc/app/Type.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/TypesController.html b/doc/app/TypesController.html index e69e052..a3f1ed0 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 +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper @@ -186,7 +194,7 @@

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 42
    +            
    # File app/controllers/types_controller.rb, line 56
     def create
       @type = Type.new(params[:type])
     
    @@ -226,7 +234,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 74
    +            
    # File app/controllers/types_controller.rb, line 88
     def destroy
       @type = Type.find(params[:id])
       @type.destroy
    @@ -262,7 +270,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 36
    +            
    # File app/controllers/types_controller.rb, line 50
     def edit
       @type = Type.find(params[:id])
     end
    @@ -327,7 +335,7 @@

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 26
    +            
    # File app/controllers/types_controller.rb, line 40
     def new
       @type = Type.new
     
    @@ -346,6 +354,42 @@ 

    Public Instance Methods

    +
    + +
    + ordered_index() + click to toggle source +
    + + +
    + +

    GET /types/ordered_index GET /types/ordered_index.json

    + + + +
    +
    # File app/controllers/types_controller.rb, line 15
    +def ordered_index
    +  @types = Type.find(:all,:order => :name)
    +
    +  respond_to do |format|
    +    format.html # ordered_index.html.erb
    +    format.json { render json: @type }
    +  end
    +
    +end
    +
    + +
    + + + + +
    + +
    @@ -362,7 +406,7 @@

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 15
    +            
    # File app/controllers/types_controller.rb, line 27
     def show
       @type = Type.find(params[:id])
     
    @@ -397,7 +441,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 58
    +            
    # File app/controllers/types_controller.rb, line 72
     def update
       @type = Type.find(params[:id])
     
    diff --git a/doc/app/TypesHelper.html b/doc/app/TypesHelper.html
    index d7e732d..7fa0b66 100644
    --- a/doc/app/TypesHelper.html
    +++ b/doc/app/TypesHelper.html
    @@ -81,6 +81,12 @@ 

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/User.html b/doc/app/User.html index 5fa3862..756c7f0 100644 --- a/doc/app/User.html +++ b/doc/app/User.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/Visit.html b/doc/app/Visit.html index ad56b8f..53837a6 100644 --- a/doc/app/Visit.html +++ b/doc/app/Visit.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/VisitsController.html b/doc/app/VisitsController.html index 00709aa..1d535cb 100644 --- a/doc/app/VisitsController.html +++ b/doc/app/VisitsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/VisitsHelper.html b/doc/app/VisitsHelper.html index 4ff2034..0cd627c 100644 --- a/doc/app/VisitsHelper.html +++ b/doc/app/VisitsHelper.html @@ -81,6 +81,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/created.rid b/doc/app/created.rid index 2aaa3ea..be2b058 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 +Mon, 23 Apr 2012 15:50:56 -0700 +doc/README_FOR_APP Wed, 28 Mar 2012 13:16:07 -0700 +app/models/trip.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/models/comentario.rb Sun, 15 Apr 2012 11:18:56 -0700 +app/models/visit.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/models/site.rb Sun, 15 Apr 2012 11:02:44 -0700 +app/models/user.rb Sun, 15 Apr 2012 11:01:36 -0700 +app/models/type.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/helpers/trips_helper.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/helpers/sites_helper.rb Wed, 28 Mar 2012 13:16:07 -0700 +app/helpers/visits_helper.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/helpers/types_helper.rb Wed, 28 Mar 2012 13:16:07 -0700 +app/helpers/application_helper.rb Wed, 28 Mar 2012 13:16:07 -0700 +app/helpers/comentarios_helper.rb Sun, 15 Apr 2012 09:39:17 -0700 +app/helpers/planet_helper.rb Wed, 28 Mar 2012 13:16:07 -0700 +app/controllers/visits_controller.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/controllers/planet_controller.rb Mon, 23 Apr 2012 15:13:13 -0700 +app/controllers/application_controller.rb Wed, 28 Mar 2012 13:16:07 -0700 +app/controllers/comentarios_controller.rb Sun, 15 Apr 2012 09:39:17 -0700 +app/controllers/types_controller.rb Thu, 29 Mar 2012 10:48:31 -0700 +app/controllers/trips_controller.rb Sun, 15 Apr 2012 08:32:47 -0700 +app/controllers/sites_controller.rb Sun, 15 Apr 2012 08:32:47 -0700 diff --git a/doc/app/doc/README_FOR_APP.html b/doc/app/doc/README_FOR_APP.html index cfe337b..577df8f 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 +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • 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..8cddd7f 100644 --- a/doc/app/index.html +++ b/doc/app/index.html @@ -63,6 +63,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comentario + +
  • ComentariosController + +
  • ComentariosHelper +
  • PlanetController
  • PlanetHelper diff --git a/doc/app/js/search_index.js b/doc/app/js/search_index.js index f5703f3..2460f3a 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","comentario","comentarioscontroller","comentarioshelper","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()","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","comentario","comentarioscontroller","comentarioshelper","planetcontroller","planethelper","site","sitescontroller","siteshelper","trip","tripscontroller","tripshelper","type","typescontroller","typeshelper","user","visit","visitscontroller","visitshelper","planetcontroller#author()","planetcontroller#contact()","comentarioscontroller#create()","sitescontroller#create()","tripscontroller#create()","typescontroller#create()","visitscontroller#create()","comentarioscontroller#destroy()","sitescontroller#destroy()","tripscontroller#destroy()","typescontroller#destroy()","visitscontroller#destroy()","comentarioscontroller#edit()","sitescontroller#edit()","tripscontroller#edit()","typescontroller#edit()","visitscontroller#edit()","planetcontroller#ejemplo()","comentarioscontroller#index()","planetcontroller#index()","sitescontroller#index()","tripscontroller#index()","typescontroller#index()","visitscontroller#index()","comentarioscontroller#new()","sitescontroller#new()","tripscontroller#new()","typescontroller#new()","visitscontroller#new()","typescontroller#ordered_index()","planetcontroller#search()","comentarioscontroller#show()","sitescontroller#show()","tripscontroller#show()","typescontroller#show()","visitscontroller#show()","comentarioscontroller#update()","sitescontroller#update()","tripscontroller#update()","typescontroller#update()","visitscontroller#update()",""],"info":[["ApplicationController","","ApplicationController.html","",""],["ApplicationHelper","","ApplicationHelper.html","",""],["Comentario","","Comentario.html","",""],["ComentariosController","","ComentariosController.html","",""],["ComentariosHelper","","ComentariosHelper.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","ComentariosController","ComentariosController.html#method-i-create","()","

    POST /comentarios POST /comentarios.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","ComentariosController","ComentariosController.html#method-i-destroy","()","

    DELETE /comentarios/1 DELETE /comentarios/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","ComentariosController","ComentariosController.html#method-i-edit","()","

    GET /comentarios/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","ComentariosController","ComentariosController.html#method-i-index","()","

    GET /comentarios GET /comentarios.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","ComentariosController","ComentariosController.html#method-i-new","()","

    GET /comentarios/new GET /comentarios/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","()","

    GET /types/ordered_index GET /types/ordered_index.json\n"],["search","PlanetController","PlanetController.html#method-i-search","()",""],["show","ComentariosController","ComentariosController.html#method-i-show","()","

    GET /comentarios/1 GET /comentarios/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","ComentariosController","ComentariosController.html#method-i-update","()","

    PUT /comentarios/1 PUT /comentarios/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..508f900 100644 --- a/doc/app/table_of_contents.html +++ b/doc/app/table_of_contents.html @@ -38,6 +38,15 @@

    Classes/Modules

  • ApplicationHelper +
  • +
  • + Comentario +
  • +
  • + ComentariosController +
  • +
  • + ComentariosHelper
  • PlanetController @@ -95,51 +104,71 @@

    Classes/Modules

    Methods