From 573f21b9b09d53d98759280010a46b60f9cc638a Mon Sep 17 00:00:00 2001 From: Ubuntu11 Date: Wed, 28 Mar 2012 13:27:23 -0700 Subject: [PATCH 1/9] =?UTF-8?q?a=C3=B1adir=20acci=C3=B3n=20ejemplo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/planet_controller.rb | 3 ++ app/controllers/planet_controller.rb~ | 11 ++++ app/views/layouts/application.html.erb | 6 ++- app/views/layouts/application.html.erb~ | 33 ++++++++++++ config/routes.rb | 2 + config/routes.rb~ | 72 +++++++++++++++++++++++++ 6 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 app/controllers/planet_controller.rb~ create mode 100644 app/views/layouts/application.html.erb~ create mode 100644 config/routes.rb~ diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index be7ac0a..7625cb7 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -8,4 +8,7 @@ def contact def ejemplo end + def author + end + end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ new file mode 100644 index 0000000..be7ac0a --- /dev/null +++ b/app/controllers/planet_controller.rb~ @@ -0,0 +1,11 @@ +class PlanetController < ApplicationController + def index + end + + def contact + end + + def ejemplo + end + +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1ed9716..0e57e37 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,11 +23,13 @@ <%= link_to "Home", planet_index_path %>
<%= link_to "Tipos", types_path %>
<%= link_to "Sitios", sites_path %>
- <%= link_to "Contact", planet_contact_path %> + <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Ejemplo", planet_ejemplo_path %>
+ <%= link_to "Author", planet_author_path %>
<%= yield %>
- \ 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..1ed9716 --- /dev/null +++ b/app/views/layouts/application.html.erb~ @@ -0,0 +1,33 @@ + + + + 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 %> +
+
+ <%= yield %> +
+
+ + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 716dc7e..b09b835 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,8 @@ get "planet/ejemplo" + get "planet/author" + # 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..716dc7e --- /dev/null +++ b/config/routes.rb~ @@ -0,0 +1,72 @@ +Planet::Application.routes.draw do + resources :sites + + resources :types do # Rutas anidadas /types/id/sites..., + resources :sites, :only => [ :index ] # Restringe a acción “index” + end + + get "planet/index" + + get "planet/contact" + + get "planet/ejemplo" + + # 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 From c92154aeaf9e39763119fc83ae6fea30cce0d3e1 Mon Sep 17 00:00:00 2001 From: Ubuntu11 Date: Wed, 28 Mar 2012 13:35:19 -0700 Subject: [PATCH 2/9] =?UTF-8?q?a=C3=B1adir=20acci=C3=B3n=20author=20y=20pa?= =?UTF-8?q?gina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/images/foto.jpg | Bin 0 -> 13501 bytes app/views/planet/author.html.erb | 1 + app/views/planet/author.html.erb~ | 1 + 3 files changed, 2 insertions(+) create mode 100755 app/assets/images/foto.jpg create mode 100644 app/views/planet/author.html.erb create mode 100644 app/views/planet/author.html.erb~ diff --git a/app/assets/images/foto.jpg b/app/assets/images/foto.jpg new file mode 100755 index 0000000000000000000000000000000000000000..60f27f104ff7b4dd9e9a5244579507beeadb863a GIT binary patch literal 13501 zcmbWdcT^K!6fPR1cL5QQE+9&k-ifGyfOP3iiXb4p1qei`g7hj~=}3w6-n&Te9TJcZ z2_*zb!sU1GUH7i_{(A52nOSSrnsa9DZ_b%rzP)c3ZZ`n;)m79~0C;$KfcJL?;C31C z3UCh(@4xeZ3qB$Ke?mk+fKNzFL`?kOMM6qWN+X| zWpy{b-Xwxs%*Hc>lqPsjb}y zdxwvXPF~(VzJ4J8fY7k;h{&%|(MicEscGroGcxlF3X6(MO3QxL)YjEEG&VK2^z`=i z4-5_s|CySenVp+oSX|nK!MC>m?dtQ-p|CNtf8#gYL2D7m^1r6Mt5BlX8jaA?R&9C&?aii*NEE z|AY2Fk^R2|7V`fK+5Z9de{n4VDDd&_77w2W00jKK1%$XBbUZ=c0tSH;{Vu)cJ62}?wrJ+l$%4(I#2`lagLv8^WMr>Gzd^h3@CM(eJ)6Sh%i4*vA<@t+? z%l_aa5VdaIygYrO<>K)T>uk23a%%+nZ@j!^d?UUJa>mN_8mYkeJ^P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S{{YVb6jJ~I literal 0 HcmV?d00001 diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb new file mode 100644 index 0000000..23acb71 --- /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') %>

CV

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..2bc520d --- /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') %>

CV 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 From a4fa92a67e035964fe2f39137b64f89dee5a756f Mon Sep 17 00:00:00 2001 From: Ubuntu11 Date: Wed, 28 Mar 2012 13:39:39 -0700 Subject: [PATCH 3/9] =?UTF-8?q?a=C3=B1adir=20test=20de=20funcionalidad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/functional/planet_controller_test.rb | 11 +++++++++++ test/functional/planet_controller_test.rb~ | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/functional/planet_controller_test.rb~ diff --git a/test/functional/planet_controller_test.rb b/test/functional/planet_controller_test.rb index 88229e0..195dd60 100644 --- a/test/functional/planet_controller_test.rb +++ b/test/functional/planet_controller_test.rb @@ -10,5 +10,16 @@ class PlanetControllerTest < ActionController::TestCase get :contact assert_response :success end + + test "should get ejemplo" do + get :ejemplo + assert_response :success + end + + test "should get author" do + get :author + assert_response :success + end + end diff --git a/test/functional/planet_controller_test.rb~ b/test/functional/planet_controller_test.rb~ new file mode 100644 index 0000000..88229e0 --- /dev/null +++ b/test/functional/planet_controller_test.rb~ @@ -0,0 +1,14 @@ +require 'test_helper' + +class PlanetControllerTest < ActionController::TestCase + test "should get index" do + get :index + assert_response :success + end + + test "should get contact" do + get :contact + assert_response :success + end + +end From fa78456c1cfa9c69b3a785dfd788187c2b8c635e Mon Sep 17 00:00:00 2001 From: Ubuntu11 Date: Wed, 28 Mar 2012 15:06:27 -0700 Subject: [PATCH 4/9] =?UTF-8?q?a=C3=B1adir=20accion=20de=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/types_controller.rb | 11 ++++ app/controllers/types_controller.rb~ | 94 ++++++++++++++++++++++++++++ app/views/planet/author.html.erb | 2 +- app/views/planet/author.html.erb~ | 2 +- app/views/planet/contact.html.erb | 2 +- app/views/planet/contact.html.erb~ | 1 + app/views/planet/ejemplo.html.erb | 4 +- app/views/planet/ejemplo.html.erb~ | 3 + app/views/planet/index.html.erb | 2 +- app/views/planet/index.html.erb~ | 1 + app/views/types/_form.html.erb | 14 +++++ app/views/types/_form.html.erb~ | 25 ++++++++ app/views/types/edit.html.erb | 14 +++++ app/views/types/edit.html.erb~ | 6 ++ app/views/types/index.html.erb | 16 +++++ app/views/types/index.html.erb~ | 44 +++++++++++++ app/views/types/new.html.erb | 14 +++++ app/views/types/new.html.erb~ | 5 ++ app/views/types/ordered_index.erb | 46 ++++++++++++++ app/views/types/ordered_index.erb~ | 46 ++++++++++++++ app/views/types/show.html.erb | 18 ++++++ app/views/types/show.html.erb~ | 33 ++++++++++ config/routes.rb | 9 +++ config/routes.rb~ | 10 +++ 24 files changed, 415 insertions(+), 7 deletions(-) create mode 100644 app/controllers/types_controller.rb~ create mode 100644 app/views/planet/contact.html.erb~ create mode 100644 app/views/planet/ejemplo.html.erb~ create mode 100644 app/views/planet/index.html.erb~ create mode 100644 app/views/types/_form.html.erb~ create mode 100644 app/views/types/edit.html.erb~ create mode 100644 app/views/types/index.html.erb~ create mode 100644 app/views/types/new.html.erb~ create mode 100644 app/views/types/ordered_index.erb create mode 100644 app/views/types/ordered_index.erb~ create mode 100644 app/views/types/show.html.erb~ diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..8614a60 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -21,6 +21,17 @@ def show end end + # GET /types/ordered_index + # GET /types/ordered_index.json + def ordered_index + @type = Type.find(params[:id]) + + respond_to do |format| + format.html # ordered_index.html.erb + format.json { render json: @type } + 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..827e062 --- /dev/null +++ b/app/controllers/types_controller.rb~ @@ -0,0 +1,94 @@ +class TypesController < ApplicationController + # GET /types + # GET /types.json + def index + @types = Type.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @types } + end + end + + # GET /types/1 + # GET /types/1.json + def show + @type = Type.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @type } + end + end + + # GET /types/1 + # GET /types/1.json + def ordered_index + @type = Type.find(params[:id]) + + respond_to do |format| + format.html # ordered_index.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/views/planet/author.html.erb b/app/views/planet/author.html.erb index 23acb71..967aab7 100644 --- a/app/views/planet/author.html.erb +++ b/app/views/planet/author.html.erb @@ -1 +1 @@ -

Roberto Fuentes Martinez

Direccion postal:

Plaza Martinez Olmedilla, 8

28031 MADRID

Email: rfm_it@yahoo.es

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

CV

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 +<%= 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) %>

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', types_ordered_index_path) %> \ No newline at end of file diff --git a/app/views/planet/author.html.erb~ b/app/views/planet/author.html.erb~ index 2bc520d..f254d76 100644 --- a/app/views/planet/author.html.erb~ +++ b/app/views/planet/author.html.erb~ @@ -1 +1 @@ -

Roberto Fuentes Martinez

Direccion postal: Plaza Martinez Olmedilla, 8 28031 MADRID Email: rfm_it@yahoo.es

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

CV 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 +<%= 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) %>

Roberto Fuentes Martinez

Direccion postal:

Plaza Martinez Olmedilla, 8

28031 MADRID

Email: rfm_it@yahoo.es

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

CV

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/contact.html.erb b/app/views/planet/contact.html.erb index f339edd..38f28e7 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 +<%= 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) %>

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', types_ordered_index_path) %> \ 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..f339edd --- /dev/null +++ b/app/views/planet/contact.html.erb~ @@ -0,0 +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 diff --git a/app/views/planet/ejemplo.html.erb b/app/views/planet/ejemplo.html.erb index cb05eb9..6ee461b 100644 --- a/app/views/planet/ejemplo.html.erb +++ b/app/views/planet/ejemplo.html.erb @@ -1,3 +1 @@ -

ERb: Extended Ruby

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

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

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

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

ERb: Extended Ruby

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

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

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

<%= 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) %> \ No newline at end of file diff --git a/app/views/planet/ejemplo.html.erb~ b/app/views/planet/ejemplo.html.erb~ new file mode 100644 index 0000000..cb05eb9 --- /dev/null +++ b/app/views/planet/ejemplo.html.erb~ @@ -0,0 +1,3 @@ +

ERb: Extended Ruby

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

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

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

\ No newline at end of file diff --git a/app/views/planet/index.html.erb b/app/views/planet/index.html.erb index bbee722..9f7c3ee 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 +<%= 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) %>

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_index_path) %> <%= link_to('Type/OrderedIndex', types_ordered_index_path) %> \ 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..bbee722 --- /dev/null +++ b/app/views/planet/index.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/types/_form.html.erb b/app/views/types/_form.html.erb index 03447aa..d75d576 100644 --- a/app/views/types/_form.html.erb +++ b/app/views/types/_form.html.erb @@ -1,3 +1,10 @@ +<%= 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) %> + <%= form_for(@type) do |f| %> <% if @type.errors.any? %>
@@ -23,3 +30,10 @@ <%= 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', types_ordered_index_path) %> diff --git a/app/views/types/_form.html.erb~ b/app/views/types/_form.html.erb~ new file mode 100644 index 0000000..03447aa --- /dev/null +++ b/app/views/types/_form.html.erb~ @@ -0,0 +1,25 @@ +<%= 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 %> diff --git a/app/views/types/edit.html.erb b/app/views/types/edit.html.erb index fa73e65..89c0222 100644 --- a/app/views/types/edit.html.erb +++ b/app/views/types/edit.html.erb @@ -1,6 +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', types_ordered_index_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', types_ordered_index_path) %> diff --git a/app/views/types/edit.html.erb~ b/app/views/types/edit.html.erb~ new file mode 100644 index 0000000..fa73e65 --- /dev/null +++ b/app/views/types/edit.html.erb~ @@ -0,0 +1,6 @@ +

Editing type

+ +<%= render 'form' %> + +<%= link_to 'Show', @type %> | +<%= link_to 'Back', types_path %> diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index e761359..17574ae 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -1,3 +1,10 @@ +<%= 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

@@ -10,6 +17,8 @@
<%= link_to type.name, type_sites_path(type) %>
<%= truncate(strip_tags(type.description), :length => 80) %>
+ +
<%= type.updated_at %>
@@ -28,3 +37,10 @@
<%= 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/index.html.erb~ b/app/views/types/index.html.erb~ new file mode 100644 index 0000000..b439a62 --- /dev/null +++ b/app/views/types/index.html.erb~ @@ -0,0 +1,44 @@ +<%= 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) %>
+
+
+ <%= 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/new.html.erb b/app/views/types/new.html.erb index 0670946..a79da29 100644 --- a/app/views/types/new.html.erb +++ b/app/views/types/new.html.erb @@ -1,5 +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', types_ordered_index_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', types_ordered_index_path) %> diff --git a/app/views/types/new.html.erb~ b/app/views/types/new.html.erb~ new file mode 100644 index 0000000..0670946 --- /dev/null +++ b/app/views/types/new.html.erb~ @@ -0,0 +1,5 @@ +

New type

+ +<%= render 'form' %> + +<%= link_to 'Back', 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..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/show.html.erb b/app/views/types/show.html.erb index 98b32e7..1e71bb7 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -1,3 +1,10 @@ +<%= 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 %>

@@ -10,6 +17,17 @@ <%= @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/show.html.erb~ b/app/views/types/show.html.erb~ new file mode 100644 index 0000000..1e71bb7 --- /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', 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/config/routes.rb b/config/routes.rb index b09b835..72728cd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,14 @@ Planet::Application.routes.draw do resources :sites + get "types/index" + + get "types/ordered_index" + resources :types do # Rutas anidadas /types/id/sites..., + + + resources :sites, :only => [ :index ] # Restringe a acción “index” end @@ -13,6 +20,8 @@ get "planet/author" + + # The priority is based upon order of creation: # first created -> highest priority. diff --git a/config/routes.rb~ b/config/routes.rb~ index 716dc7e..556d941 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -2,6 +2,10 @@ Planet::Application.routes.draw do resources :sites resources :types do # Rutas anidadas /types/id/sites..., + + get "types/index" + + get "types/ordered_index" resources :sites, :only => [ :index ] # Restringe a acción “index” end @@ -11,6 +15,12 @@ Planet::Application.routes.draw do get "planet/ejemplo" + get "planet/author" + + get "types/index" + + get "types/ordered_index" + # The priority is based upon order of creation: # first created -> highest priority. From 9a6cc26bb1714324ca149c3d98222b292e57905b Mon Sep 17 00:00:00 2001 From: Roberto Fuentes Date: Wed, 28 Mar 2012 16:56:25 -0700 Subject: [PATCH 5/9] =?UTF-8?q?a=C3=B1adir=20accion=20ordered=5Findex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/types_controller.rb | 21 +++++++----- app/controllers/types_controller.rb~ | 7 ++-- app/views/sites/ordered_index.html.erb | 47 ++++++++++++++++++++++++++ app/views/types/index.html.erb | 3 +- app/views/types/index.html.erb~ | 2 ++ app/views/types/ordered_index.erb~ | 45 +++++++++--------------- app/views/types/ordered_index.html.erb | 47 ++++++++++++++++++++++++++ config/routes.rb | 4 ++- config/routes.rb~ | 11 +++--- 9 files changed, 139 insertions(+), 48 deletions(-) create mode 100644 app/views/sites/ordered_index.html.erb create mode 100644 app/views/types/ordered_index.html.erb diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index 8614a60..7c668e6 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -10,28 +10,31 @@ def index end end - # GET /types/1 - # GET /types/1.json - def show - @type = Type.find(params[:id]) + # GET /types/ordered_index + # GET /types/ordered_index.json + def ordered_index + @type = Type.find(:all,:order => :name) respond_to do |format| - format.html # show.html.erb + format.html # ordered_index.html.erb format.json { render json: @type } end + end - # GET /types/ordered_index - # GET /types/ordered_index.json - def ordered_index + # GET /types/1 + # GET /types/1.json + def show @type = Type.find(params[:id]) respond_to do |format| - format.html # ordered_index.html.erb + format.html # show.html.erb format.json { render json: @type } 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~ index 827e062..7b22f2a 100644 --- a/app/controllers/types_controller.rb~ +++ b/app/controllers/types_controller.rb~ @@ -21,15 +21,16 @@ class TypesController < ApplicationController end end - # GET /types/1 - # GET /types/1.json + # GET /types/ordered_index + # GET /types/ordered_index.json def ordered_index - @type = Type.find(params[:id]) + @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/new 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/types/index.html.erb b/app/views/types/index.html.erb index 17574ae..38197a3 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -23,7 +23,8 @@ - <%= link_to 'Show', type %>
+ <%= link_to 'Show', type %>
+ <%= link_to 'Ordered_index', type %>
<%= link_to 'Edit', edit_type_path(type) %>
<%= link_to 'Destroy', type, :confirm => 'Are you sure?', diff --git a/app/views/types/index.html.erb~ b/app/views/types/index.html.erb~ index b439a62..17574ae 100644 --- a/app/views/types/index.html.erb~ +++ b/app/views/types/index.html.erb~ @@ -17,6 +17,8 @@
<%= link_to type.name, type_sites_path(type) %>
<%= truncate(strip_tags(type.description), :length => 80) %>
+ +
<%= type.updated_at %>
diff --git a/app/views/types/ordered_index.erb~ b/app/views/types/ordered_index.erb~ index 17574ae..1e71bb7 100644 --- a/app/views/types/ordered_index.erb~ +++ b/app/views/types/ordered_index.erb~ @@ -5,38 +5,25 @@ <%= 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) %>
+

<%= notice %>

-
<%= type.updated_at %>
-
-
- <%= link_to 'Show', type %>
- <%= link_to 'Edit', edit_type_path(type) %>
- <%= link_to 'Destroy', type, - :confirm => 'Are you sure?', - :method => :delete %> -
-
+

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

-
+

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

-<%= link_to 'New Type', new_type_path %> +

+ 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) %> diff --git a/app/views/types/ordered_index.html.erb b/app/views/types/ordered_index.html.erb new file mode 100644 index 0000000..38197a3 --- /dev/null +++ b/app/views/types/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/config/routes.rb b/config/routes.rb index 72728cd..b408c05 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,11 @@ Planet::Application.routes.draw do + get "types/ordered_index" + resources :sites get "types/index" - get "types/ordered_index" + resources :types do # Rutas anidadas /types/id/sites..., diff --git a/config/routes.rb~ b/config/routes.rb~ index 556d941..72728cd 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -1,11 +1,14 @@ Planet::Application.routes.draw do resources :sites - resources :types do # Rutas anidadas /types/id/sites..., - get "types/index" get "types/ordered_index" + + resources :types do # Rutas anidadas /types/id/sites..., + + + resources :sites, :only => [ :index ] # Restringe a acción “index” end @@ -17,9 +20,7 @@ Planet::Application.routes.draw do get "planet/author" - get "types/index" - - get "types/ordered_index" + # The priority is based upon order of creation: # first created -> highest priority. From 41cbb88adb71ae589c3e454c26c0ca7670ae7dae Mon Sep 17 00:00:00 2001 From: Roberto Fuentes Date: Thu, 29 Mar 2012 11:14:51 -0700 Subject: [PATCH 6/9] finalizado --- app/controllers/planet_controller.rb | 1 + app/controllers/planet_controller.rb~ | 6 +++++ app/controllers/types_controller.rb | 2 +- app/controllers/types_controller.rb~ | 22 ++++++++-------- app/views/layouts/application.html.erb | 17 ++++++++++++- app/views/layouts/application.html.erb~ | 7 +++-- app/views/planet/author.html.erb | 2 +- app/views/planet/author.html.erb~ | 2 +- app/views/planet/contact.html.erb | 2 +- app/views/planet/contact.html.erb~ | 2 +- app/views/planet/ejemplo.html.erb | 2 +- app/views/planet/ejemplo.html.erb~ | 4 +-- app/views/planet/index.html.erb | 2 +- app/views/planet/index.html.erb~ | 2 +- app/views/types/_form.html.erb | 14 ++-------- app/views/types/_form.html.erb~ | 14 ++++++++++ app/views/types/edit.html.erb | 14 +--------- app/views/types/edit.html.erb~ | 14 ++++++++++ app/views/types/index.html.erb | 14 +--------- app/views/types/index.html.erb~ | 16 +++--------- app/views/types/new.html.erb | 14 ++-------- app/views/types/new.html.erb~ | 14 ++++++++++ app/views/types/ordered_index.html.erb | 14 ---------- app/views/types/ordered_index.html.erb~ | 34 +++++++++++++++++++++++++ app/views/types/show.html.erb | 14 +--------- app/views/types/show.html.erb~ | 4 +-- config/routes.rb | 17 ++++++++++--- config/routes.rb~ | 9 ++++++- 28 files changed, 158 insertions(+), 121 deletions(-) create mode 100644 app/views/types/ordered_index.html.erb~ diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index 7625cb7..eb76adb 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -11,4 +11,5 @@ def ejemplo def author end + end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ index be7ac0a..371b94b 100644 --- a/app/controllers/planet_controller.rb~ +++ b/app/controllers/planet_controller.rb~ @@ -8,4 +8,10 @@ class PlanetController < ApplicationController def ejemplo end + def author + end + + def ordered_index + end + end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index 7c668e6..2186e4e 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -13,7 +13,7 @@ def index # GET /types/ordered_index # GET /types/ordered_index.json def ordered_index - @type = Type.find(:all,:order => :name) + @types = Type.find(:all,:order => :name) respond_to do |format| format.html # ordered_index.html.erb diff --git a/app/controllers/types_controller.rb~ b/app/controllers/types_controller.rb~ index 7b22f2a..7c668e6 100644 --- a/app/controllers/types_controller.rb~ +++ b/app/controllers/types_controller.rb~ @@ -10,6 +10,18 @@ class TypesController < ApplicationController 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 @@ -21,17 +33,7 @@ class TypesController < ApplicationController 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/new # GET /types/new.json diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0e57e37..221bbcf 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -25,10 +25,25 @@ <%= 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 "Author", planet_author_path %>
+ <%= link_to "Tipos_Ordenado", ordered_index_types_path %>
+ <%= 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 %> <%= 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 %>
diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ index 1ed9716..83a44bc 100644 --- a/app/views/layouts/application.html.erb~ +++ b/app/views/layouts/application.html.erb~ @@ -23,11 +23,14 @@ <%= link_to "Home", planet_index_path %>
<%= link_to "Tipos", types_path %>
<%= link_to "Sitios", sites_path %>
- <%= link_to "Contact", planet_contact_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 %>
<%= yield %>
- \ No newline at end of file + diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb index 967aab7..30c4316 100644 --- a/app/views/planet/author.html.erb +++ b/app/views/planet/author.html.erb @@ -1 +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', types_ordered_index_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', types_ordered_index_path) %> \ No newline at end of file +

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~ index f254d76..fd1ed74 100644 --- a/app/views/planet/author.html.erb~ +++ b/app/views/planet/author.html.erb~ @@ -1 +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', types_ordered_index_path) %>

Roberto Fuentes Martinez

Direccion postal:

Plaza Martinez Olmedilla, 8

28031 MADRID

Email: rfm_it@yahoo.es

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

CV

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 +<%= 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 38f28e7..676dde5 100644 --- a/app/views/planet/contact.html.erb +++ b/app/views/planet/contact.html.erb @@ -1 +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', types_ordered_index_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', types_ordered_index_path) %> \ 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~ index f339edd..5291511 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 +<%= 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 6ee461b..924c5be 100644 --- a/app/views/planet/ejemplo.html.erb +++ b/app/views/planet/ejemplo.html.erb @@ -1 +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', types_ordered_index_path) %>

ERb: Extended Ruby

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

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

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

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

ERb: Extended Ruby

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

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

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

\ No newline at end of file diff --git a/app/views/planet/ejemplo.html.erb~ b/app/views/planet/ejemplo.html.erb~ index cb05eb9..06ebd15 100644 --- a/app/views/planet/ejemplo.html.erb~ +++ b/app/views/planet/ejemplo.html.erb~ @@ -1,3 +1 @@ -

ERb: Extended Ruby

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

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

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

\ No newline at end of file +<%= 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
  • Anotación no visible: <% "esto NO se ve" %>
  • Anotación visible: <%= "esto SI se ve" %>
  • Anotación no visible: <% t=Time.now %>
  • Anotación visible: <%= "hoy es: " + t.to_s %>

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

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

<%= 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 9f7c3ee..e353909 100644 --- a/app/views/planet/index.html.erb +++ b/app/views/planet/index.html.erb @@ -1 +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', types_ordered_index_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_index_path) %> <%= link_to('Type/OrderedIndex', types_ordered_index_path) %> \ 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~ index bbee722..33b0ece 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 +<%= 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/types/_form.html.erb b/app/views/types/_form.html.erb index d75d576..29c9fcc 100644 --- a/app/views/types/_form.html.erb +++ b/app/views/types/_form.html.erb @@ -1,9 +1,4 @@ -<%= 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) %> + <%= form_for(@type) do |f| %> <% if @type.errors.any? %> @@ -31,9 +26,4 @@ <% 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', types_ordered_index_path) %> + diff --git a/app/views/types/_form.html.erb~ b/app/views/types/_form.html.erb~ index 03447aa..e0ba2b7 100644 --- a/app/views/types/_form.html.erb~ +++ b/app/views/types/_form.html.erb~ @@ -1,3 +1,10 @@ +<%= 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? %>
@@ -23,3 +30,10 @@ <%= 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 89c0222..6b85503 100644 --- a/app/views/types/edit.html.erb +++ b/app/views/types/edit.html.erb @@ -1,10 +1,3 @@ -<%= 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) %> -

Editing type

<%= render 'form' %> @@ -12,9 +5,4 @@ <%= 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', types_ordered_index_path) %> + diff --git a/app/views/types/edit.html.erb~ b/app/views/types/edit.html.erb~ index fa73e65..4bf95b8 100644 --- a/app/views/types/edit.html.erb~ +++ b/app/views/types/edit.html.erb~ @@ -1,6 +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 38197a3..679fe0a 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -1,9 +1,3 @@ -<%= 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

@@ -24,7 +18,6 @@ <%= link_to 'Show', type %>
- <%= link_to 'Ordered_index', type %>
<%= link_to 'Edit', edit_type_path(type) %>
<%= link_to 'Destroy', type, :confirm => 'Are you sure?', @@ -39,9 +32,4 @@ <%= 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/index.html.erb~ b/app/views/types/index.html.erb~ index 17574ae..49a74ea 100644 --- a/app/views/types/index.html.erb~ +++ b/app/views/types/index.html.erb~ @@ -1,9 +1,3 @@ -<%= 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

@@ -23,7 +17,8 @@ - <%= link_to 'Show', type %>
+ <%= link_to 'Show', type %>
+ <%= link_to 'Ordered_index', type %>
<%= link_to 'Edit', edit_type_path(type) %>
<%= link_to 'Destroy', type, :confirm => 'Are you sure?', @@ -38,9 +33,4 @@ <%= 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/new.html.erb b/app/views/types/new.html.erb index a79da29..3360843 100644 --- a/app/views/types/new.html.erb +++ b/app/views/types/new.html.erb @@ -1,9 +1,4 @@ -<%= 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) %> +

New type

@@ -11,9 +6,4 @@ <%= 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/new.html.erb~ b/app/views/types/new.html.erb~ index 0670946..fe36ba1 100644 --- a/app/views/types/new.html.erb~ +++ b/app/views/types/new.html.erb~ @@ -1,5 +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.html.erb b/app/views/types/ordered_index.html.erb index 38197a3..a3e28e9 100644 --- a/app/views/types/ordered_index.html.erb +++ b/app/views/types/ordered_index.html.erb @@ -1,10 +1,3 @@ -<%= 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

@@ -24,7 +17,6 @@ <%= link_to 'Show', type %>
- <%= link_to 'Ordered_index', type %>
<%= link_to 'Edit', edit_type_path(type) %>
<%= link_to 'Destroy', type, :confirm => 'Are you sure?', @@ -39,9 +31,3 @@ <%= 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.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 1e71bb7..04648de 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -1,10 +1,3 @@ -<%= 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 %>

@@ -25,9 +18,4 @@ <%= 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/show.html.erb~ b/app/views/types/show.html.erb~ index 1e71bb7..c2cd7e1 100644 --- a/app/views/types/show.html.erb~ +++ b/app/views/types/show.html.erb~ @@ -3,7 +3,7 @@ <%= 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) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %>

<%= notice %>

@@ -30,4 +30,4 @@ <%= 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) %> +<%= link_to('Type/OrderedIndex', ordered_index_types_path) %> diff --git a/config/routes.rb b/config/routes.rb index b408c05..2cd1d9f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,19 +1,28 @@ Planet::Application.routes.draw do - get "types/ordered_index" + resources :sites - get "types/index" + - 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" diff --git a/config/routes.rb~ b/config/routes.rb~ index 72728cd..8e81bed 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -1,17 +1,24 @@ Planet::Application.routes.draw do + + resources :sites get "types/index" get "types/ordered_index" + + resources :types do # Rutas anidadas /types/id/sites..., resources :sites, :only => [ :index ] # Restringe a acción “index” - end + end + + + get "planet/index" get "planet/contact" From 009f25e8581bc2767dd4c09bdadcfc6f2dc2c09b Mon Sep 17 00:00:00 2001 From: Roberto Fuentes Date: Sun, 15 Apr 2012 13:28:49 -0700 Subject: [PATCH 7/9] Version final --- app/views/comentarios/_form.html.erb | 11 +++---- app/views/comentarios/_form.html.erb~ | 29 +++++++++++++++++++ app/views/comentarios/index.html.erb | 41 +++++++++++++++------------ app/views/comentarios/index.html.erb~ | 10 +++---- app/views/sites/show.html.erb | 25 ++++++---------- app/views/sites/show.html.erb~ | 20 +++++-------- config/routes.rb | 4 ++- config/routes.rb~ | 2 +- 8 files changed, 81 insertions(+), 61 deletions(-) create mode 100644 app/views/comentarios/_form.html.erb~ diff --git a/app/views/comentarios/_form.html.erb b/app/views/comentarios/_form.html.erb index 59a35a4..7f1faf7 100644 --- a/app/views/comentarios/_form.html.erb +++ b/app/views/comentarios/_form.html.erb @@ -13,15 +13,12 @@
<%= f.label :coment %>
- <%= f.text_field :coment %> -
-
- <%= f.label :user_id %>
- <%= f.number_field :user_id %> + <%= f.text_area :coment, :maxlength => 240,:rows => 6 %>
+
- <%= f.label :site_id %>
- <%= f.number_field :site_id %> + <%= f.label :site_id %>
+ <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %>
<%= f.submit %> 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:

+ +
    + <% @comentario.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% 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/index.html.erb b/app/views/comentarios/index.html.erb index 04abeac..e10c106 100644 --- a/app/views/comentarios/index.html.erb +++ b/app/views/comentarios/index.html.erb @@ -1,27 +1,32 @@ -

Listing comentarios

+
+

Listing Comentarios

- - - - - - - - <% @comentarios.each do |comentario| %> - - - - - - - - + + + + + + + + <% end %>
ComentUserSite
<%= comentario.coment %><%= comentario.user_id %><%= comentario.site_id %><%= link_to 'Show', comentario %><%= link_to 'Edit', edit_comentario_path(comentario) %><%= link_to 'Destroy', comentario, confirm: 'Are you sure?', method: :delete %>
<%= 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 'Añada su comentario', new_comentario_path %>
+<%= 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~ index 640a086..33f7998 100644 --- a/app/views/comentarios/index.html.erb~ +++ b/app/views/comentarios/index.html.erb~ @@ -13,15 +13,15 @@ <% @comentarios.each do |comentario| %> <%= comentario.coment %> - <%= comentario.user_id %> - <%= comentario.site_id %> + <%= comentario.user %> + <%= comentario.site %> <%= link_to 'Show', comentario %> - <%= link_to 'Edit', edit_comentario_path(comentario) %> - <%= link_to 'Destroy', comentario, confirm: 'Are you sure?', method: :delete %> + <%= 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 %> <% end %>
-<%= link_to 'New Comentario', new_comentario_path %> +<%= link_to 'Añada su comentario', new_comentario_path %>
diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 4680ee0..58b47ea 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -1,31 +1,24 @@
-

<%= @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 %>

- -

Comentarios

-

Autor: - <%= @comentario.user_id %> -

- -

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

+ <%= @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 %>

diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ index bfc724c..f920ac1 100644 --- a/app/views/sites/show.html.erb~ +++ b/app/views/sites/show.html.erb~ @@ -8,17 +8,13 @@

<%=sanitize @site.description %>

- -

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

- -

Comentarios

- -

Autor: - +

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

-

<%=sanitize @comentario.coment if @site.user %>

+ <%= link_to 'Ver Comentarios', site_comentarios_path(@site.id) if @site.comentarios.exists? %> + <%= link_to 'Añadir un comentario', new_comentario_path %> +
@@ -26,7 +22,5 @@

-<% 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/config/routes.rb b/config/routes.rb index 6af193b..f051625 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,9 @@ devise_for :users - resources :sites + resources :sites do + resources :comentarios + end diff --git a/config/routes.rb~ b/config/routes.rb~ index eddcac4..6af193b 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -42,7 +42,7 @@ Planet::Application.routes.draw do get "planet/author" - get "planet/comentarios" + From 07f527b31a6082818e050baf759b30fff184a691 Mon Sep 17 00:00:00 2001 From: Roberto Fuentes Date: Sun, 22 Apr 2012 13:14:00 -0700 Subject: [PATCH 8/9] Entrega 7 --- Gemfile.lock | 6 +-- app/views/sites/_form.html.erb | 54 +++++++++++++++++-- app/views/sites/_form.html.erb? | 33 ++++++++++++ app/views/sites/_geo.html.erb | 48 +++++++++++++++++ app/views/sites/index.html.erb | 13 +++-- app/views/sites/index.html.erb~ | 13 +++-- app/views/sites/show.html.erb | 8 +++ app/views/sites/show.html.erb~ | 26 ++++----- app/views/trips/show.html.erb | 0 db/migrate/20120320100145_create_sites.rb | 2 +- db/migrate/20120320100145_create_sites.rb~ | 14 +++++ .../20120422170530_addlongitud_tosites.rb | 16 ++++++ .../20120422170530_addlongitud_tosites.rb~ | 16 ++++++ .../20120422170605_addlatitud_tosites.rb | 7 +++ db/migrate/20120422170639_addzoom_tosites.rb | 7 +++ .../20120422173317_addcampos_tosites.rb | 16 ++++++ .../20120422173317_addcampos_tosites.rb~ | 16 ++++++ .../20120422173528_addlonglatzoom_tosites.rb | 16 ++++++ .../20120422173528_addlonglatzoom_tosites.rb~ | 7 +++ .../20120422173703_addnewzoom_tosites.rb | 9 ++++ .../20120422173703_addnewzoom_tosites.rb~ | 7 +++ .../20120422182402_changezoom_tosites.rb | 7 +++ .../20120422184508_deletenuevas_to_sites.rb | 11 ++++ .../20120422184508_deletenuevas_to_sites.rb~ | 7 +++ db/schema.rb | 18 ++----- 25 files changed, 333 insertions(+), 44 deletions(-) mode change 100644 => 100755 app/views/sites/_form.html.erb create mode 100644 app/views/sites/_form.html.erb? create mode 100755 app/views/sites/_geo.html.erb mode change 100644 => 100755 app/views/trips/show.html.erb create mode 100644 db/migrate/20120320100145_create_sites.rb~ create mode 100644 db/migrate/20120422170530_addlongitud_tosites.rb create mode 100644 db/migrate/20120422170530_addlongitud_tosites.rb~ create mode 100644 db/migrate/20120422170605_addlatitud_tosites.rb create mode 100644 db/migrate/20120422170639_addzoom_tosites.rb create mode 100644 db/migrate/20120422173317_addcampos_tosites.rb create mode 100644 db/migrate/20120422173317_addcampos_tosites.rb~ create mode 100644 db/migrate/20120422173528_addlonglatzoom_tosites.rb create mode 100644 db/migrate/20120422173528_addlonglatzoom_tosites.rb~ create mode 100644 db/migrate/20120422173703_addnewzoom_tosites.rb create mode 100644 db/migrate/20120422173703_addnewzoom_tosites.rb~ create mode 100644 db/migrate/20120422182402_changezoom_tosites.rb create mode 100644 db/migrate/20120422184508_deletenuevas_to_sites.rb create mode 100644 db/migrate/20120422184508_deletenuevas_to_sites.rb~ 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/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:

+ +
    + <% @site.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :description %>
+ <%= f.text_area :description , :rows => 4 %> +
+
+ <%= f.label :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 59ea3d3..0d7d6b9 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -6,18 +6,21 @@ - <%= link_to image_tag(site.image.url, :class => 'list_image'), site %> + <%= 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 'Comentarios', comentarios_path %>
+ :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 %> @@ -31,7 +34,7 @@ <% end %>
- +
<%= link_to 'New site', new_site_path %> diff --git a/app/views/sites/index.html.erb~ b/app/views/sites/index.html.erb~ index 51a8b9c..6d5d5f5 100644 --- a/app/views/sites/index.html.erb~ +++ b/app/views/sites/index.html.erb~ @@ -6,18 +6,21 @@ - <%= link_to image_tag(site.image.url, :class => 'list_image'), site %> + <%= 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 'Comentarios', comentarios_path %> + :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 %> @@ -31,7 +34,7 @@ <% 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 58b47ea..de417ee 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -8,6 +8,14 @@

<%=sanitize @site.description %>

+

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

<%= render "geo"%>
+ +

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

diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ index f920ac1..58b47ea 100644 --- a/app/views/sites/show.html.erb~ +++ b/app/views/sites/show.html.erb~ @@ -1,26 +1,28 @@
-

<%= @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 %>

- - <%= link_to 'Ver Comentarios', site_comentarios_path(@site.id) if @site.comentarios.exists? %> - <%= link_to 'Añadir un comentario', new_comentario_path %> +

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/trips/show.html.erb b/app/views/trips/show.html.erb old mode 100644 new mode 100755 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/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 2f92e9c..b6c1275 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120415163917) do +ActiveRecord::Schema.define(:version => 20120422173317) do create_table "comentarios", :force => true do |t| t.string "coment" @@ -21,20 +21,8 @@ t.datetime "updated_at", :null => false end - create_table "sites", :force => true do |t| - t.string "name" - t.text "description" - t.integer "type_id" - t.string "image_url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - t.string "image_file_name" - t.string "image_content_type" - t.string "image_file_size" - t.datetime "image_updated_at" - t.integer "visitas", :default => 0 - 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" From 5f37cb27b759c5319440cb11fa520e6256bad660 Mon Sep 17 00:00:00 2001 From: Roberto Fuentes Date: Mon, 23 Apr 2012 16:24:00 -0700 Subject: [PATCH 9/9] busqueda y final --- app/controllers/planet_controller.rb | 9 + app/controllers/planet_controller.rb~ | 30 +- app/views/layouts/application.html.erb | 10 +- app/views/layouts/application.html.erb~ | 14 +- app/views/planet/menosdetres.html.erb | 1 + app/views/planet/menosdetres.html.erb~ | 1 + app/views/planet/search.html.erb | 1 + app/views/planet/search.html.erb~ | 1 + app/views/sites/search.html.erb | 39 ++ app/views/sites/search.html.erb~ | 40 ++ config/routes.rb | 4 + config/routes.rb~ | 6 +- doc/app/ApplicationController.html | 6 + doc/app/ApplicationHelper.html | 6 + doc/app/Comentario.html | 163 ++++++ doc/app/ComentariosController.html | 442 ++++++++++++++ doc/app/ComentariosHelper.html | 157 +++++ doc/app/PlanetController.html | 80 ++- doc/app/PlanetHelper.html | 6 + doc/app/Site.html | 6 + doc/app/SitesController.html | 6 + doc/app/SitesHelper.html | 6 + doc/app/Trip.html | 6 + doc/app/TripsController.html | 6 + doc/app/TripsHelper.html | 6 + doc/app/Type.html | 6 + doc/app/TypesController.html | 56 +- doc/app/TypesHelper.html | 6 + doc/app/User.html | 6 + doc/app/Visit.html | 6 + doc/app/VisitsController.html | 6 + doc/app/VisitsHelper.html | 6 + doc/app/created.rid | 41 +- doc/app/doc/README_FOR_APP.html | 6 + doc/app/images/add.png | Bin doc/app/images/delete.png | Bin doc/app/images/tag_blue.png | Bin doc/app/index.html | 6 + doc/app/js/search_index.js | 2 +- doc/app/table_of_contents.html | 63 +- documentacion/ActiveSupport.html | 248 ++++++++ documentacion/ActiveSupport/TestCase.html | 255 ++++++++ documentacion/AddPaperclipToSites.html | 343 +++++++++++ documentacion/AddcamposTosites.html | 340 +++++++++++ documentacion/AddlatitudTosites.html | 331 +++++++++++ documentacion/AddlongitudTosites.html | 340 +++++++++++ documentacion/AddlonglatzoomTosites.html | 340 +++++++++++ documentacion/AddnewzoomTosites.html | 333 +++++++++++ documentacion/AddzoomTosites.html | 331 +++++++++++ documentacion/ApplicationController.html | 255 ++++++++ documentacion/ApplicationHelper.html | 249 ++++++++ documentacion/BrowsingTest.html | 305 ++++++++++ documentacion/ChangezoomTosites.html | 331 +++++++++++ documentacion/Comentario.html | 255 ++++++++ documentacion/ComentarioTest.html | 255 ++++++++ documentacion/ComentariosController.html | 534 +++++++++++++++++ documentacion/ComentariosControllerTest.html | 255 ++++++++ documentacion/ComentariosHelper.html | 249 ++++++++ documentacion/ComentariosHelperTest.html | 255 ++++++++ documentacion/CreateComentarios.html | 307 ++++++++++ documentacion/CreateSites.html | 308 ++++++++++ documentacion/CreateTrips.html | 308 ++++++++++ documentacion/CreateTypes.html | 306 ++++++++++ documentacion/CreateVisits.html | 307 ++++++++++ documentacion/DeletenuevasToSites.html | 335 +++++++++++ documentacion/DeviseCreateUsers.html | 345 +++++++++++ documentacion/Gemfile.html | 259 +++++++++ documentacion/Object.html | 282 +++++++++ documentacion/Planet.html | 249 ++++++++ documentacion/Planet/Application.html | 255 ++++++++ documentacion/PlanetController.html | 466 +++++++++++++++ documentacion/PlanetControllerTest.html | 255 ++++++++ documentacion/PlanetHelper.html | 249 ++++++++ documentacion/PlanetHelperTest.html | 255 ++++++++ documentacion/README_rdoc.html | 508 ++++++++++++++++ documentacion/Rakefile.html | 219 +++++++ documentacion/Site.html | 255 ++++++++ documentacion/SiteTest.html | 255 ++++++++ documentacion/SiteVisitas.html | 337 +++++++++++ documentacion/SitesController.html | 575 +++++++++++++++++++ documentacion/SitesControllerTest.html | 255 ++++++++ documentacion/SitesHelper.html | 249 ++++++++ documentacion/SitesHelperTest.html | 255 ++++++++ documentacion/Trip.html | 255 ++++++++ documentacion/TripTest.html | 255 ++++++++ documentacion/TripsController.html | 535 +++++++++++++++++ documentacion/TripsControllerTest.html | 255 ++++++++ documentacion/TripsHelper.html | 249 ++++++++ documentacion/TripsHelperTest.html | 255 ++++++++ documentacion/Type.html | 255 ++++++++ documentacion/TypeTest.html | 255 ++++++++ documentacion/TypesController.html | 572 ++++++++++++++++++ documentacion/TypesControllerTest.html | 255 ++++++++ documentacion/TypesHelper.html | 249 ++++++++ documentacion/TypesHelperTest.html | 255 ++++++++ documentacion/User.html | 255 ++++++++ documentacion/UserName.html | 337 +++++++++++ documentacion/UserSites.html | 337 +++++++++++ documentacion/UserTest.html | 255 ++++++++ documentacion/Visit.html | 255 ++++++++ documentacion/VisitTest.html | 255 ++++++++ documentacion/VisitsController.html | 535 +++++++++++++++++ documentacion/VisitsControllerTest.html | 255 ++++++++ documentacion/VisitsHelper.html | 249 ++++++++ documentacion/VisitsHelperTest.html | 255 ++++++++ documentacion/created.rid | 141 +++++ documentacion/doc/README_FOR_APP.html | 216 +++++++ documentacion/images/add.png | Bin 0 -> 733 bytes documentacion/images/brick.png | Bin 0 -> 452 bytes documentacion/images/brick_link.png | Bin 0 -> 764 bytes documentacion/images/bug.png | Bin 0 -> 774 bytes documentacion/images/bullet_black.png | Bin 0 -> 211 bytes documentacion/images/bullet_toggle_minus.png | Bin 0 -> 207 bytes documentacion/images/bullet_toggle_plus.png | Bin 0 -> 209 bytes documentacion/images/date.png | Bin 0 -> 626 bytes documentacion/images/delete.png | Bin 0 -> 715 bytes documentacion/images/find.png | Bin 0 -> 659 bytes documentacion/images/loadingAnimation.gif | Bin 0 -> 5886 bytes documentacion/images/macFFBgHack.png | Bin 0 -> 207 bytes documentacion/images/package.png | Bin 0 -> 853 bytes documentacion/images/page_green.png | Bin 0 -> 621 bytes documentacion/images/page_white_text.png | Bin 0 -> 342 bytes documentacion/images/page_white_width.png | Bin 0 -> 309 bytes documentacion/images/plugin.png | Bin 0 -> 591 bytes documentacion/images/ruby.png | Bin 0 -> 592 bytes documentacion/images/tag_blue.png | Bin 0 -> 1880 bytes documentacion/images/tag_green.png | Bin 0 -> 613 bytes documentacion/images/transparent.png | Bin 0 -> 97 bytes documentacion/images/wrench.png | Bin 0 -> 610 bytes documentacion/images/wrench_orange.png | Bin 0 -> 584 bytes documentacion/images/zoom.png | Bin 0 -> 692 bytes documentacion/index.html | 208 +++++++ documentacion/js/darkfish.js | 153 +++++ documentacion/js/jquery.js | 18 + documentacion/js/navigation.js | 142 +++++ documentacion/js/search.js | 94 +++ documentacion/js/search_index.js | 1 + documentacion/js/searcher.js | 228 ++++++++ documentacion/public/robots_txt.html | 218 +++++++ documentacion/rdoc.css | 543 +++++++++++++++++ documentacion/table_of_contents.html | 410 +++++++++++++ test/functional/planet_controller_test.rb | 5 + test/functional/planet_controller_test.rb~ | 12 + 143 files changed, 23424 insertions(+), 58 deletions(-) create mode 100644 app/views/planet/menosdetres.html.erb create mode 100644 app/views/planet/menosdetres.html.erb~ create mode 100644 app/views/planet/search.html.erb create mode 100644 app/views/planet/search.html.erb~ create mode 100644 app/views/sites/search.html.erb create mode 100644 app/views/sites/search.html.erb~ create mode 100644 doc/app/Comentario.html create mode 100644 doc/app/ComentariosController.html create mode 100644 doc/app/ComentariosHelper.html mode change 100755 => 100644 doc/app/images/add.png mode change 100755 => 100644 doc/app/images/delete.png mode change 100755 => 100644 doc/app/images/tag_blue.png create mode 100644 documentacion/ActiveSupport.html create mode 100644 documentacion/ActiveSupport/TestCase.html create mode 100644 documentacion/AddPaperclipToSites.html create mode 100644 documentacion/AddcamposTosites.html create mode 100644 documentacion/AddlatitudTosites.html create mode 100644 documentacion/AddlongitudTosites.html create mode 100644 documentacion/AddlonglatzoomTosites.html create mode 100644 documentacion/AddnewzoomTosites.html create mode 100644 documentacion/AddzoomTosites.html create mode 100644 documentacion/ApplicationController.html create mode 100644 documentacion/ApplicationHelper.html create mode 100644 documentacion/BrowsingTest.html create mode 100644 documentacion/ChangezoomTosites.html create mode 100644 documentacion/Comentario.html create mode 100644 documentacion/ComentarioTest.html create mode 100644 documentacion/ComentariosController.html create mode 100644 documentacion/ComentariosControllerTest.html create mode 100644 documentacion/ComentariosHelper.html create mode 100644 documentacion/ComentariosHelperTest.html create mode 100644 documentacion/CreateComentarios.html create mode 100644 documentacion/CreateSites.html create mode 100644 documentacion/CreateTrips.html create mode 100644 documentacion/CreateTypes.html create mode 100644 documentacion/CreateVisits.html create mode 100644 documentacion/DeletenuevasToSites.html create mode 100644 documentacion/DeviseCreateUsers.html create mode 100644 documentacion/Gemfile.html create mode 100644 documentacion/Object.html create mode 100644 documentacion/Planet.html create mode 100644 documentacion/Planet/Application.html create mode 100644 documentacion/PlanetController.html create mode 100644 documentacion/PlanetControllerTest.html create mode 100644 documentacion/PlanetHelper.html create mode 100644 documentacion/PlanetHelperTest.html create mode 100644 documentacion/README_rdoc.html create mode 100644 documentacion/Rakefile.html create mode 100644 documentacion/Site.html create mode 100644 documentacion/SiteTest.html create mode 100644 documentacion/SiteVisitas.html create mode 100644 documentacion/SitesController.html create mode 100644 documentacion/SitesControllerTest.html create mode 100644 documentacion/SitesHelper.html create mode 100644 documentacion/SitesHelperTest.html create mode 100644 documentacion/Trip.html create mode 100644 documentacion/TripTest.html create mode 100644 documentacion/TripsController.html create mode 100644 documentacion/TripsControllerTest.html create mode 100644 documentacion/TripsHelper.html create mode 100644 documentacion/TripsHelperTest.html create mode 100644 documentacion/Type.html create mode 100644 documentacion/TypeTest.html create mode 100644 documentacion/TypesController.html create mode 100644 documentacion/TypesControllerTest.html create mode 100644 documentacion/TypesHelper.html create mode 100644 documentacion/TypesHelperTest.html create mode 100644 documentacion/User.html create mode 100644 documentacion/UserName.html create mode 100644 documentacion/UserSites.html create mode 100644 documentacion/UserTest.html create mode 100644 documentacion/Visit.html create mode 100644 documentacion/VisitTest.html create mode 100644 documentacion/VisitsController.html create mode 100644 documentacion/VisitsControllerTest.html create mode 100644 documentacion/VisitsHelper.html create mode 100644 documentacion/VisitsHelperTest.html create mode 100644 documentacion/created.rid create mode 100644 documentacion/doc/README_FOR_APP.html create mode 100644 documentacion/images/add.png create mode 100644 documentacion/images/brick.png create mode 100644 documentacion/images/brick_link.png create mode 100644 documentacion/images/bug.png create mode 100644 documentacion/images/bullet_black.png create mode 100644 documentacion/images/bullet_toggle_minus.png create mode 100644 documentacion/images/bullet_toggle_plus.png create mode 100644 documentacion/images/date.png create mode 100644 documentacion/images/delete.png create mode 100644 documentacion/images/find.png create mode 100644 documentacion/images/loadingAnimation.gif create mode 100644 documentacion/images/macFFBgHack.png create mode 100644 documentacion/images/package.png create mode 100644 documentacion/images/page_green.png create mode 100644 documentacion/images/page_white_text.png create mode 100644 documentacion/images/page_white_width.png create mode 100644 documentacion/images/plugin.png create mode 100644 documentacion/images/ruby.png create mode 100644 documentacion/images/tag_blue.png create mode 100644 documentacion/images/tag_green.png create mode 100644 documentacion/images/transparent.png create mode 100644 documentacion/images/wrench.png create mode 100644 documentacion/images/wrench_orange.png create mode 100644 documentacion/images/zoom.png create mode 100644 documentacion/index.html create mode 100644 documentacion/js/darkfish.js create mode 100644 documentacion/js/jquery.js create mode 100644 documentacion/js/navigation.js create mode 100644 documentacion/js/search.js create mode 100644 documentacion/js/search_index.js create mode 100644 documentacion/js/searcher.js create mode 100644 documentacion/public/robots_txt.html create mode 100644 documentacion/rdoc.css create mode 100644 documentacion/table_of_contents.html diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index 9637e74..c98ce96 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -33,5 +33,14 @@ def ejemplo 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~ index 371b94b..9637e74 100644 --- a/app/controllers/planet_controller.rb~ +++ b/app/controllers/planet_controller.rb~ @@ -1,17 +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 - def ordered_index - end - + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c864840..2b57459 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -18,6 +18,10 @@

diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ index 1136a1d..e338c76 100644 --- a/app/views/layouts/application.html.erb~ +++ b/app/views/layouts/application.html.erb~ @@ -18,6 +18,10 @@ 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/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/config/routes.rb b/config/routes.rb index f051625..0658590 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,6 +44,10 @@ get "planet/author" + get "planet/search" + + get "doc/app" + diff --git a/config/routes.rb~ b/config/routes.rb~ index 6af193b..0faf1e4 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -11,7 +11,9 @@ Planet::Application.routes.draw do devise_for :users - resources :sites + resources :sites do + resources :comentarios + end @@ -42,6 +44,8 @@ Planet::Application.routes.draw do get "planet/author" + get "planet/search" + 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