From d6ab03dfd1b21bdba59438aa92bb1d7c9f7c0258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Tue, 24 Apr 2012 17:58:44 +0200 Subject: [PATCH 1/7] =?UTF-8?q?A=C3=B1adidos=20requisitos=20entrega=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 19 +++-- Gemfile.lock | 11 +-- app/assets/images/antonio.jpg | Bin 0 -> 4666 bytes app/assets/images/fer.jpg | Bin 0 -> 23778 bytes app/controllers/planet_controller.rb | 3 + app/controllers/planet_controller.rb~ | 33 ++++++++ app/controllers/types_controller.rb | 15 +++- app/controllers/types_controller.rb~ | 93 +++++++++++++++++++++ app/views/layouts/application.html.erb | 25 ++++-- app/views/layouts/application.html.erb~ | 50 +++++++++++ app/views/planet/author.html.erb | 32 +++++++ app/views/planet/author.html.erb~ | 2 + app/views/types/index.html.erb | 3 +- app/views/types/index.html.erb~ | 30 +++++++ app/views/types/show.html.erb | 4 + app/views/types/show.html.erb~ | 15 ++++ config/routes.rb | 3 + config/routes.rb~ | 82 ++++++++++++++++++ test/functional/planet_controller_test.rb | 10 +++ test/functional/planet_controller_test.rb~ | 15 ++++ 20 files changed, 421 insertions(+), 24 deletions(-) create mode 100644 app/assets/images/antonio.jpg create mode 100644 app/assets/images/fer.jpg create mode 100644 app/controllers/planet_controller.rb~ create mode 100644 app/controllers/types_controller.rb~ create mode 100644 app/views/layouts/application.html.erb~ create mode 100644 app/views/planet/author.html.erb create mode 100644 app/views/planet/author.html.erb~ create mode 100644 app/views/types/index.html.erb~ create mode 100644 app/views/types/show.html.erb~ create mode 100644 config/routes.rb~ create mode 100644 test/functional/planet_controller_test.rb~ diff --git a/Gemfile b/Gemfile index ec2ba7b..321d59d 100644 --- a/Gemfile +++ b/Gemfile @@ -2,16 +2,19 @@ source 'https://rubygems.org' gem 'rails', '3.2.2' +#gem 'execjs' +#gem 'therubyracer' + # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' +gem 'sqlite3' +#group :development, :test do +# gem 'sqlite3' +#end -group :development, :test do - gem 'sqlite3' -end - -group :production do - gem 'pg' -end +#group :production do +# gem 'pg' +#end gem 'devise' @@ -47,5 +50,5 @@ gem 'paperclip' # To use debugger # gem 'ruby-debug19', :require => 'ruby-debug' -gem 'json', '1.6.5' +# gem 'json', '1.6.5' diff --git a/Gemfile.lock b/Gemfile.lock index fd905dc..da265f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,13 +54,13 @@ GEM jquery-rails (2.0.2) railties (>= 3.2.0, < 5.0) thor (~> 0.14) - json (1.6.5) + json (1.6.6) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.18) - multi_json (1.3.1) + multi_json (1.3.2) orm_adapter (0.0.7) paperclip (3.0.2) activemodel (>= 3.0.0) @@ -68,7 +68,6 @@ GEM activesupport (>= 3.0.0) cocaine (>= 0.0.2) mime-types - pg (0.13.2) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) @@ -95,7 +94,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 +103,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) @@ -125,9 +124,7 @@ DEPENDENCIES coffee-rails (~> 3.2.1) devise jquery-rails - json (= 1.6.5) paperclip - pg rails (= 3.2.2) sass-rails (~> 3.2.3) sqlite3 diff --git a/app/assets/images/antonio.jpg b/app/assets/images/antonio.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ee737ce3ff27c6db010e62beb38561bb163f1457 GIT binary patch literal 4666 zcmbW2c{tQ>_s2hD>`Ru&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V0`^tKZV!VdmQ&}h93@sv(ODde>>EGL) zz*m=5xX$eR3<~F@l0GL@XJF$P_C4tvF6u`uy9amq^&*NZ=&g0B@z3Et?f(FRaeO~m zG~X0>&U2Y(bkc3Ia#d6Zl>R4Ygt4J<4%kR%hpZz*o))-<)G@N{R?XWdkDzzcf)^`Qot*Ed+;afFGP=tvVU^pelBD zz#S-}f>|ixl&g`J!*SPx%`;%yc9XOLMHO8MV^H)2oc5{J@&bn;iRau=MM%lwnO!lo zt_Kw^1{cf<+2E-j_7l)PxtqJpO+24z$H>2$xe zG#7ew4mKiOOtQZu6^~~>@Dq>5iYuB5(r3SntvZ-$F_YMlqDv_*?CxC4X=buWJh6iO zp#i>t?XCw>x{~Te$ry-~MIABzO%zt>@QZdRQXZjKASOLeT>UHb58wxa7sB5LbOdZI z#p)eGZv4n{qdv+MeiTtzR(lN{^fro;b>MWxTDY?kEOW*J$rVHkN^Mx literal 0 HcmV?d00001 diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index a8636bd..9eb2fe9 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -29,5 +29,8 @@ def contact # Método que define una acción vacía del controlador def ejemplo end + # Acción author + def author + end end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ new file mode 100644 index 0000000..a8636bd --- /dev/null +++ b/app/controllers/planet_controller.rb~ @@ -0,0 +1,33 @@ +# 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 + +end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..d32f3af 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -1,8 +1,8 @@ class TypesController < ApplicationController # GET /types # GET /types.json - def index - @types = Type.all + def index + @types = Type.all #busca colección de recursos respond_to do |format| format.html # index.html.erb @@ -13,7 +13,7 @@ def index # GET /types/1 # GET /types/1.json def show - @type = Type.find(params[:id]) + @type = Type.find(params[:id]) #busca elemento en la tabla respond_to do |format| format.html # show.html.erb @@ -80,4 +80,13 @@ def destroy format.json { head :no_content } end end + + # ordered_index + def ordered_index + @types = Type.find(:all, :order => :name) + respond_to do |format| + format.html { render action: "index" } + format.json { render json: @types } + end + end end diff --git a/app/controllers/types_controller.rb~ b/app/controllers/types_controller.rb~ new file mode 100644 index 0000000..4aa7b77 --- /dev/null +++ b/app/controllers/types_controller.rb~ @@ -0,0 +1,93 @@ +class TypesController < ApplicationController + # GET /types + # GET /types.json + def index + @types = Type.all #busca colección de recursos + + 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]) #busca elemento en la tabla + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @type } + end + end + + # GET /types/new + # GET /types/new.json + def new + @type = Type.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @type } + end + end + + # GET /types/1/edit + def edit + @type = Type.find(params[:id]) + end + + # POST /types + # POST /types.json + def create + @type = Type.new(params[:type]) + + respond_to do |format| + if @type.save + format.html { redirect_to @type, notice: 'Type was successfully created.' } + format.json { render json: @type, status: :created, location: @type } + else + format.html { render action: "new" } + format.json { render json: @type.errors, status: :unprocessable_entity } + end + end + end + + # PUT /types/1 + # PUT /types/1.json + def update + @type = Type.find(params[:id]) + + respond_to do |format| + if @type.update_attributes(params[:type]) + format.html { redirect_to @type, notice: 'Type was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @type.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /types/1 + # DELETE /types/1.json + def destroy + @type = Type.find(params[:id]) + @type.destroy + + respond_to do |format| + format.html { redirect_to types_url } + format.json { head :no_content } + end + end +end + + # ordered_index + def ordered_index + @types = Type.find(:all, :order => :name) + respond_to do |format| + format.html { render action: "index" } + format.json { render json: @types } + end + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e4c9e36..8cb93f7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,7 +6,11 @@ <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> - + @@ -14,7 +18,14 @@ - \ No newline at end of file + diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ new file mode 100644 index 0000000..acda53b --- /dev/null +++ b/app/views/layouts/application.html.erb~ @@ -0,0 +1,50 @@ + + + + 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 "Viajes", trips_path %>
+ <%= link_to "Contact", planet_contact_path %>
+ <%= link_to "Sign up", new_user_registration_path unless current_user %> +
+
+

<%= notice %>

<%= alert %>

+ +<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', ordered_index_type_path) %> + <%= yield %> +
+<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', ordered_index_type_path) %> +
+
+ + diff --git a/app/views/planet/author.html.erb b/app/views/planet/author.html.erb new file mode 100644 index 0000000..1194642 --- /dev/null +++ b/app/views/planet/author.html.erb @@ -0,0 +1,32 @@ +

Autores:

+ + + + + + +
+
    +
  • Nombre: Fernando Valdenebro González
    +
  • Dirección postal: C/Posadas Nº.1, San Ildefonso, SEGOVIA, ESPAÑA
    +
  • Email: fernandolg_upm@hotmail.com
    +
  • Fecha de nacimiento: 14/09/1989
    +
  • Estudios: Ingeniero de Telecomunicación (ETSIT-UPM)
    +
  • Especialidad: Telemática
    +
+
+ <%= image_tag('fer.jpg') %> + +
+
    +
  • Nombre: Antonio José Turel Rodríguez
    +
  • Dirección postal: (sin definir)
    +
  • Email: antonioturel@gmail.com
    +
  • Fecha de nacimiento: (sin definir)
    +
  • Estudios: Ingeniero de Telecomunicación (ETSIT-UPM)
    +
  • Especialidad: Telemática
    +
+ <%= image_tag('antonio.jpg') %> + +
+ diff --git a/app/views/planet/author.html.erb~ b/app/views/planet/author.html.erb~ new file mode 100644 index 0000000..2a42c8e --- /dev/null +++ b/app/views/planet/author.html.erb~ @@ -0,0 +1,2 @@ +

Planet#author

+

Find me in app/views/planet/author.html.erb

diff --git a/app/views/types/index.html.erb b/app/views/types/index.html.erb index e761359..7627f62 100644 --- a/app/views/types/index.html.erb +++ b/app/views/types/index.html.erb @@ -9,7 +9,8 @@
<%= link_to type.name, type_sites_path(type) %>
<%= truncate(strip_tags(type.description), - :length => 80) %>
+ :length => 80) %> +
Fecha de modificación: <%= (type.updated_at)%>
diff --git a/app/views/types/index.html.erb~ b/app/views/types/index.html.erb~ new file mode 100644 index 0000000..e761359 --- /dev/null +++ b/app/views/types/index.html.erb~ @@ -0,0 +1,30 @@ +
+

Listing Types

+ + + <% @types.each do |type| %> + + + + + + + <% end %> +
+
+
<%= link_to type.name, type_sites_path(type) %>
+
<%= truncate(strip_tags(type.description), + :length => 80) %>
+
+
+ <%= link_to 'Show', type %>
+ <%= link_to 'Edit', edit_type_path(type) %>
+ <%= link_to 'Destroy', type, + :confirm => 'Are you sure?', + :method => :delete %> +
+
+ +
+ +<%= link_to 'New Type', new_type_path %> diff --git a/app/views/types/show.html.erb b/app/views/types/show.html.erb index 98b32e7..fb8bb05 100644 --- a/app/views/types/show.html.erb +++ b/app/views/types/show.html.erb @@ -10,6 +10,10 @@ <%= @type.description %>

+

+ Fecha de modificación: + <%= (@type.updated_at)%> +

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

<%= notice %>

+ +

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

+ +

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

+ + +<%= link_to 'Edit', edit_type_path(@type) %> | +<%= link_to 'Back', types_path %> diff --git a/config/routes.rb b/config/routes.rb index 29d3c86..1c50de0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,8 @@ Planet::Application.routes.draw do + get "planet/author" + get "types/ordered_index" + resources :visits resources :trips diff --git a/config/routes.rb~ b/config/routes.rb~ new file mode 100644 index 0000000..22870e8 --- /dev/null +++ b/config/routes.rb~ @@ -0,0 +1,82 @@ +Planet::Application.routes.draw do + + get "planet/author" + # get "types/ordered_index" + + resources :visits + + resources :trips + + devise_for :users + + 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 diff --git a/test/functional/planet_controller_test.rb b/test/functional/planet_controller_test.rb index ce15d1b..9a68887 100644 --- a/test/functional/planet_controller_test.rb +++ b/test/functional/planet_controller_test.rb @@ -12,4 +12,14 @@ class PlanetControllerTest < ActionController::TestCase assert_response :success end + test "should get author" do + get :author + assert_response :success + end + + test "should get ejemplo" do + get :ejemplo + 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..ce15d1b --- /dev/null +++ b/test/functional/planet_controller_test.rb~ @@ -0,0 +1,15 @@ +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 9ae57eeea16f43ec542dd8a334a2fd888ae05523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Tue, 24 Apr 2012 21:00:51 +0200 Subject: [PATCH 2/7] =?UTF-8?q?A=C3=B1adida=20posibilidad=20de=20crear=20c?= =?UTF-8?q?omentarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/comments.js.coffee | 3 + app/assets/stylesheets/comments.css.scss | 3 + app/controllers/comments_controller.rb | 87 ++++++++++++++++++++ app/controllers/comments_controller.rb~ | 87 ++++++++++++++++++++ app/helpers/comments_helper.rb | 2 + app/models/comment.rb | 4 + app/models/comment.rb~ | 2 + app/models/site.rb | 3 + app/models/site.rb~ | 14 ++++ app/models/user.rb | 2 + app/models/user.rb~ | 15 ++++ app/views/comments/_form.html.erb | 30 +++++++ app/views/comments/_form.html.erb~ | 30 +++++++ app/views/comments/edit.html.erb | 6 ++ app/views/comments/index.html.erb | 29 +++++++ app/views/comments/index.html.erb~ | 29 +++++++ app/views/comments/new.html.erb | 5 ++ app/views/comments/show.html.erb | 20 +++++ app/views/comments/show.html.erb~ | 20 +++++ app/views/sites/index.html.erb | 11 ++- app/views/sites/index.html.erb~ | 38 +++++++++ app/views/sites/show.html.erb | 25 +++++- app/views/sites/show.html.erb~ | 39 +++++++++ config/routes.rb | 6 ++ config/routes.rb~ | 4 +- db/migrate/20120424164523_create_comments.rb | 11 +++ db/schema.rb | 10 ++- test/fixtures/comments.yml | 11 +++ test/functional/comments_controller_test.rb | 49 +++++++++++ test/unit/comment_test.rb | 7 ++ test/unit/helpers/comments_helper_test.rb | 4 + 31 files changed, 599 insertions(+), 7 deletions(-) create mode 100644 app/assets/javascripts/comments.js.coffee create mode 100644 app/assets/stylesheets/comments.css.scss create mode 100644 app/controllers/comments_controller.rb create mode 100644 app/controllers/comments_controller.rb~ create mode 100644 app/helpers/comments_helper.rb create mode 100644 app/models/comment.rb create mode 100644 app/models/comment.rb~ create mode 100644 app/models/site.rb~ create mode 100644 app/models/user.rb~ create mode 100644 app/views/comments/_form.html.erb create mode 100644 app/views/comments/_form.html.erb~ create mode 100644 app/views/comments/edit.html.erb create mode 100644 app/views/comments/index.html.erb create mode 100644 app/views/comments/index.html.erb~ create mode 100644 app/views/comments/new.html.erb create mode 100644 app/views/comments/show.html.erb create mode 100644 app/views/comments/show.html.erb~ create mode 100644 app/views/sites/index.html.erb~ create mode 100644 app/views/sites/show.html.erb~ create mode 100644 db/migrate/20120424164523_create_comments.rb create mode 100644 test/fixtures/comments.yml create mode 100644 test/functional/comments_controller_test.rb create mode 100644 test/unit/comment_test.rb create mode 100644 test/unit/helpers/comments_helper_test.rb diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/comments.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/comments.css.scss b/app/assets/stylesheets/comments.css.scss new file mode 100644 index 0000000..3722c12 --- /dev/null +++ b/app/assets/stylesheets/comments.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the comments controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 0000000..db21626 --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,87 @@ +class CommentsController < ApplicationController + # GET /comments + # GET /comments.json + def index #gestiona las rutas anidadas + if params[:site_id].nil? or params[:site_id].empty? + @comments = Comment.all # path: /comment + else + @comments = Site.find(params[:site_id]).comments # path: /sites/id/comments + end + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @comments } + end + end + + # GET /comments/1 + # GET /comments/1.json + def show + @comment = Comment.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/new + # GET /comments/new.json + def new + @comment = Comment.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/1/edit + def edit + @comment = Comment.find(params[:id]) + end + + # POST /comments + # POST /comments.json + def create + @comment = Comment.new(params[:comment]) + + respond_to do |format| + if @comment.save + format.html { redirect_to @comment, notice: 'Comment was successfully created.' } + format.json { render json: @comment, status: :created, location: @comment } + else + format.html { render action: "new" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comments/1 + # PUT /comments/1.json + def update + @comment = Comment.find(params[:id]) + + respond_to do |format| + if @comment.update_attributes(params[:comment]) + format.html { redirect_to @comment, notice: 'Comment was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /comments/1 + # DELETE /comments/1.json + def destroy + @comment = Comment.find(params[:id]) + @comment.destroy + + respond_to do |format| + format.html { redirect_to comments_url } + format.json { head :no_content } + end + end +end diff --git a/app/controllers/comments_controller.rb~ b/app/controllers/comments_controller.rb~ new file mode 100644 index 0000000..1cfeaed --- /dev/null +++ b/app/controllers/comments_controller.rb~ @@ -0,0 +1,87 @@ +class CommentsController < ApplicationController + # GET /comments + # GET /comments.json + def index #gestiona las rutas anidadas + if params[:site_id].nil? or params[:site_id].empty? + @comments = Comment.all # path: /comment + else + @comments = Site.find(params[:site_id]).comments # path: /sites/id/comments + end + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @comments } + end + end + + # GET /comments/1 + # GET /comments/1.json + def show + @comment = Comment.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/new + # GET /comments/new.json + def new + @comment = Comment.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @comment } + end + end + + # GET /comments/1/edit + def edit + @comment = Comment.find(params[:id]) + end + + # POST /comments + # POST /comments.json + def create + @comment = Comment.new(params[:comment]) + + respond_to do |format| + if @comment.save + format.html { redirect_to @comment, notice: 'Comment was successfully created.' } + format.json { render json: @comment, status: :created, location: @comment } + else + format.html { render action: "new" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # PUT /comments/1 + # PUT /comments/1.json + def update + @comment = Comment.find(params[:id]) + + respond_to do |format| + if @comment.update_attributes(params[:comment]) + format.html { redirect_to @comment, notice: 'Comment was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /comments/1 + # DELETE /comments/1.json + def destroy + @comment = Comment.find(params[:id]) + @comment.destroy + + respond_to do |format| + format.html { redirect_to comments_url } + format.json { head :no_content } + end + end +end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 0000000..0ec9ca5 --- /dev/null +++ b/app/helpers/comments_helper.rb @@ -0,0 +1,2 @@ +module CommentsHelper +end diff --git a/app/models/comment.rb b/app/models/comment.rb new file mode 100644 index 0000000..392fe83 --- /dev/null +++ b/app/models/comment.rb @@ -0,0 +1,4 @@ +class Comment < ActiveRecord::Base + belongs_to :site + belongs_to :user +end diff --git a/app/models/comment.rb~ b/app/models/comment.rb~ new file mode 100644 index 0000000..45b2d38 --- /dev/null +++ b/app/models/comment.rb~ @@ -0,0 +1,2 @@ +class Comment < ActiveRecord::Base +end diff --git a/app/models/site.rb b/app/models/site.rb index 2b2f99a..baefe5c 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -3,6 +3,9 @@ class Site < ActiveRecord::Base belongs_to :user has_many :visits has_many :trips, :through => :visits + + has_many :comments + has_attached_file :image diff --git a/app/models/site.rb~ b/app/models/site.rb~ new file mode 100644 index 0000000..2b2f99a --- /dev/null +++ b/app/models/site.rb~ @@ -0,0 +1,14 @@ +class Site < ActiveRecord::Base + belongs_to :type + belongs_to :user + has_many :visits + has_many :trips, :through => :visits + has_attached_file :image + + + # Debe estar protegido para evitar accesos indeseados + attr_protected :user_id + + # Se añaden estas definiciones + validates :name, :type_id, :presence => true # campo obligatorio +end diff --git a/app/models/user.rb b/app/models/user.rb index 35b8159..8fc2062 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,6 +2,8 @@ class User < ActiveRecord::Base has_many :sites has_many :trips + + has_many :comments # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable diff --git a/app/models/user.rb~ b/app/models/user.rb~ new file mode 100644 index 0000000..35b8159 --- /dev/null +++ b/app/models/user.rb~ @@ -0,0 +1,15 @@ +class User < ActiveRecord::Base + + has_many :sites + has_many :trips + + # Include default devise modules. Others available are: + # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :trackable, :validatable + + validates_presence_of :name + + # Setup accessible (or protected) attributes for your model + attr_accessible :name, :email, :password, :password_confirmation, :remember_me +end diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb new file mode 100644 index 0000000..6066e87 --- /dev/null +++ b/app/views/comments/_form.html.erb @@ -0,0 +1,30 @@ +<%= form_for(@comment) do |f| %> + <% if @comment.errors.any? %> +
+

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

+ +
    + <% @comment.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :comment %>
+ <%= f.text_area :comment %> +
+
+ <%= f.label :site_id %>
+ <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %> +
+
+ <%= f.label :user_id %>
+ <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %> +
+ +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/comments/_form.html.erb~ b/app/views/comments/_form.html.erb~ new file mode 100644 index 0000000..c130af3 --- /dev/null +++ b/app/views/comments/_form.html.erb~ @@ -0,0 +1,30 @@ +<%= form_for(@comment) do |f| %> + <% if @comment.errors.any? %> +
+

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

+ +
    + <% @comment.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %> + +
+ <%= f.label :comment %>
+ <%= f.text_area :comment %> +
+ +
+ <%= f.label :user_id %>
+ <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %> +
+
+ <%= f.label :site_id %>
+ <%= f.number_field :site_id %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/comments/edit.html.erb b/app/views/comments/edit.html.erb new file mode 100644 index 0000000..12ea7f9 --- /dev/null +++ b/app/views/comments/edit.html.erb @@ -0,0 +1,6 @@ +

Editing comment

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

Listing comments

+ + + + + + + + + + + +<% @comments.each do |comment| %> + + + + + +<% if comment.user == current_user %> + + +<% end %> + +<% end %> +
CommentUserSite
<%= comment.comment %><%= comment.user.name %><%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>
+<%= link_to 'Nuevo comentario', new_comment_path %> +
+ + diff --git a/app/views/comments/index.html.erb~ b/app/views/comments/index.html.erb~ new file mode 100644 index 0000000..0608eb2 --- /dev/null +++ b/app/views/comments/index.html.erb~ @@ -0,0 +1,29 @@ +

Listing comments

+ + + + + + + + + + + +<% @comments.each do |comment| %> + + + + + +<% if comment.user == current_user %> + + +<% end %> + +<% end %> +
CommentUserSite
<%= comment.comment %><%= comment.user.name %><%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>
+ +
+ + diff --git a/app/views/comments/new.html.erb b/app/views/comments/new.html.erb new file mode 100644 index 0000000..07a754a --- /dev/null +++ b/app/views/comments/new.html.erb @@ -0,0 +1,5 @@ +

New comment

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

<%= notice %>

+ +

+ Comment: + <%= @comment.comment %> +

+ +

+ User: + <%= @comment.user.name %> +

+ +

+ Site: + <%= @comment.site.name %> +

+ +<% if @comment.user == current_user %> +<%= link_to 'Edit', edit_comment_path(@comment) %> +<% end %> diff --git a/app/views/comments/show.html.erb~ b/app/views/comments/show.html.erb~ new file mode 100644 index 0000000..b3604a0 --- /dev/null +++ b/app/views/comments/show.html.erb~ @@ -0,0 +1,20 @@ +

<%= notice %>

+ +

+ Comment: + <%= @comment.comment %> +

+ +

+ User: + <%= @comment.user.name %> +

+ +

+ Site: + <%= @comment.site.name %> +

+ +<% if comment.user == current_user %> +<%= link_to 'Edit', edit_comment_path(@comment) %> +<% end %> diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb index b8e4cae..9052504 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -14,16 +14,21 @@
<%= link_to site.name, site %>
<%= truncate(strip_tags(site.description), :length => 80) %>
+<% if site.comments!=[] %> +
<%= link_to 'Comentarios', site_comments_path(site) %>
+<% end %> <%= link_to 'Show', site %>
- <% if site.user == current_user %> <%= link_to 'Edit', edit_site_path(site) %>
+ <% if site.user == current_user %> + <%= link_to 'Edit', edit_site_path(site) %>
<%= link_to 'Destroy', site, :confirm => 'Are you sure?', :method => :delete %> - <% end %> + <% end %> + <% end %> @@ -31,4 +36,4 @@
-<%= link_to 'New site', new_site_path %> \ No newline at end of file +<%= link_to 'New site', new_site_path %> diff --git a/app/views/sites/index.html.erb~ b/app/views/sites/index.html.erb~ new file mode 100644 index 0000000..b8c87ba --- /dev/null +++ b/app/views/sites/index.html.erb~ @@ -0,0 +1,38 @@ +
+

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 'Comentarios', site_comments_path(site) %>
+
+
+ <%= link_to 'Show', site %>
+ <% if site.user == current_user %> + <%= link_to 'Edit', edit_site_path(site) %>
+ <%= link_to 'Destroy', site, + :confirm => 'Are you sure?', + :method => :delete %> + <% end %> +
+
+ +
+ +<%= link_to 'New site', new_site_path %> diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 01a5417..9e9dfb7 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -7,8 +7,26 @@

<%= @site.name %>

<%=sanitize @site.description %>

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

Comentarios:

+ + <% @site.comments.each do |comment| %> + + + +<% if comment.user == current_user %> + + +<% end %> + + <% end %> +
<%= comment.user.name %>: <%= comment.comment %><%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>
+<% end %> +

Añada su comentario:

+ <%= link_to 'Click aqui', new_comment_path %> +

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

-

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

@@ -16,4 +34,7 @@

-<% if @site.user == current_user %> <%= link_to 'Edit', edit_site_path(@site) %> | <% end %> <%= link_to 'Back', sites_path %> +<% if @site.user == current_user %> + <%= link_to 'Edit', edit_site_path(@site) %> | +<% end %> +<%= link_to 'Back', sites_path %> diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ new file mode 100644 index 0000000..c9aeabd --- /dev/null +++ b/app/views/sites/show.html.erb~ @@ -0,0 +1,39 @@ +

+ +

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

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

<%= @site.name %>

+ +

<%=sanitize @site.description %>

+ +

Comentarios:

+ + <% @site.comments.each do |comment| %> + + + +<% if comment.user == current_user %> + + +<% end %> + + <% end %> +
<%= comment.user.name %>: <%= comment.comment %><%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>
+

Añada su comentario:

+ <%= link_to 'Click aqui', new_comment_path %> +

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

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

+<% 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 1c50de0..acddb7d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,7 @@ Planet::Application.routes.draw do + resources :comments + get "planet/author" get "types/ordered_index" @@ -14,6 +16,10 @@ resources :types do # Rutas anidadas /types/id/sites..., resources :sites, :only => [ :index ] # Restringe a acción “index” end + + resources :sites do # Rutas anidadas /sites/id/comments..., + resources :comments, :only => [ :index ] # Restringe a acción “index” + end get "planet/index" diff --git a/config/routes.rb~ b/config/routes.rb~ index 22870e8..1add910 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -1,7 +1,9 @@ Planet::Application.routes.draw do + resources :comments + get "planet/author" - # get "types/ordered_index" + get "types/ordered_index" resources :visits diff --git a/db/migrate/20120424164523_create_comments.rb b/db/migrate/20120424164523_create_comments.rb new file mode 100644 index 0000000..36d0b14 --- /dev/null +++ b/db/migrate/20120424164523_create_comments.rb @@ -0,0 +1,11 @@ +class CreateComments < ActiveRecord::Migration + def change + create_table :comments do |t| + t.string :comment + t.integer :user_id + t.integer :site_id + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e6aa66f..58db2f7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,15 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120411160519) do +ActiveRecord::Schema.define(:version => 20120424164523) do + + create_table "comments", :force => true do |t| + t.string "comment" + t.integer "user_id" + t.integer "site_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end create_table "sites", :force => true do |t| t.string "name" diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml new file mode 100644 index 0000000..29c9999 --- /dev/null +++ b/test/fixtures/comments.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html + +one: + comment: MyString + user_id: 1 + site_id: 1 + +two: + comment: MyString + user_id: 1 + site_id: 1 diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb new file mode 100644 index 0000000..b2b500c --- /dev/null +++ b/test/functional/comments_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class CommentsControllerTest < ActionController::TestCase + setup do + @comment = comments(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:comments) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create comment" do + assert_difference('Comment.count') do + post :create, comment: @comment.attributes + end + + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should show comment" do + get :show, id: @comment + assert_response :success + end + + test "should get edit" do + get :edit, id: @comment + assert_response :success + end + + test "should update comment" do + put :update, id: @comment, comment: @comment.attributes + assert_redirected_to comment_path(assigns(:comment)) + end + + test "should destroy comment" do + assert_difference('Comment.count', -1) do + delete :destroy, id: @comment + end + + assert_redirected_to comments_path + end +end diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb new file mode 100644 index 0000000..b6d6131 --- /dev/null +++ b/test/unit/comment_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CommentTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb new file mode 100644 index 0000000..2518c16 --- /dev/null +++ b/test/unit/helpers/comments_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class CommentsHelperTest < ActionView::TestCase +end From 0f50cd04e4ac581da6e1569e9d2987105ce1a37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Wed, 25 Apr 2012 11:26:17 +0200 Subject: [PATCH 3/7] =?UTF-8?q?A=C3=B1adida=20geolocalizaci=C3=B3n=20y=20m?= =?UTF-8?q?apas=20para=20sitios=20y=20viajes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/comments_controller.rb | 4 +- app/controllers/comments_controller.rb~ | 6 +- app/controllers/sites_controller.rb~ | 97 +++++++++++++++ app/views/comments/_form.html.erb~ | 10 +- app/views/comments/index.html.erb~ | 2 - app/views/sites/_form.html.erb | 38 ++++++ app/views/sites/_form.html.erb~ | 71 +++++++++++ app/views/sites/_formedit.html.erb | 45 +++++++ app/views/sites/_formedit.html.erb~ | 0 app/views/sites/_geomapa.html.erb | 51 ++++++++ app/views/sites/_geomapa~ | 0 app/views/sites/edit.html.erb | 2 +- app/views/sites/edit.html.erb~ | 6 + app/views/sites/index.html.erb | 1 + app/views/sites/index.html.erb~ | 3 +- app/views/sites/show.html.erb | 3 + app/views/sites/show.html.erb~ | 6 +- app/views/trips/_mapa.html.erb | 62 ++++++++++ app/views/trips/_mapa.html.erb~ | 2 + app/views/trips/show.html.erb | 29 +---- app/views/trips/show.html.erb~ | 28 +++++ .../20120425084533_site_geolocalizacion.rb | 17 +++ .../20120425084533_site_geolocalizacion.rb~ | 7 ++ db/schema.rb | 5 +- db/seeds.rb | 16 +-- db/seeds.rb~ | 117 ++++++++++++++++++ 26 files changed, 576 insertions(+), 52 deletions(-) create mode 100644 app/controllers/sites_controller.rb~ create mode 100644 app/views/sites/_form.html.erb~ create mode 100644 app/views/sites/_formedit.html.erb create mode 100644 app/views/sites/_formedit.html.erb~ create mode 100644 app/views/sites/_geomapa.html.erb create mode 100644 app/views/sites/_geomapa~ create mode 100644 app/views/sites/edit.html.erb~ create mode 100644 app/views/trips/_mapa.html.erb create mode 100644 app/views/trips/_mapa.html.erb~ create mode 100644 app/views/trips/show.html.erb~ create mode 100644 db/migrate/20120425084533_site_geolocalizacion.rb create mode 100644 db/migrate/20120425084533_site_geolocalizacion.rb~ create mode 100644 db/seeds.rb~ diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index db21626..61d4405 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -44,7 +44,7 @@ def edit # POST /comments # POST /comments.json def create - @comment = Comment.new(params[:comment]) + @comment = Comment.new(params[:comment], params[:user_id]=>1) respond_to do |format| if @comment.save @@ -80,7 +80,7 @@ def destroy @comment.destroy respond_to do |format| - format.html { redirect_to comments_url } + format.html { redirect_to sites_url } format.json { head :no_content } end end diff --git a/app/controllers/comments_controller.rb~ b/app/controllers/comments_controller.rb~ index 1cfeaed..76a6951 100644 --- a/app/controllers/comments_controller.rb~ +++ b/app/controllers/comments_controller.rb~ @@ -3,7 +3,7 @@ class CommentsController < ApplicationController # GET /comments.json def index #gestiona las rutas anidadas if params[:site_id].nil? or params[:site_id].empty? - @comments = Comment.all # path: /comment + @comments = Comment.all # path: /comment else @comments = Site.find(params[:site_id]).comments # path: /sites/id/comments end @@ -44,7 +44,7 @@ class CommentsController < ApplicationController # POST /comments # POST /comments.json def create - @comment = Comment.new(params[:comment]) + @comment = Comment.new(params[:comment], params[:user_id]=>1) respond_to do |format| if @comment.save @@ -80,7 +80,7 @@ class CommentsController < ApplicationController @comment.destroy respond_to do |format| - format.html { redirect_to comments_url } + format.html { redirect_to planet_url } format.json { head :no_content } end end diff --git a/app/controllers/sites_controller.rb~ b/app/controllers/sites_controller.rb~ new file mode 100644 index 0000000..461cb15 --- /dev/null +++ b/app/controllers/sites_controller.rb~ @@ -0,0 +1,97 @@ +class SitesController < ApplicationController + + # authenticate_user! ejecuta acción solo si sesión existe + before_filter :authenticate_user!, :except => [ :index, :show ] + after_filter :count_visita, :only => :show + + # GET /sites + # GET /sites.json + def index + if params[:type_id].nil? or params[:type_id].empty? + @sites = Site.all # path: /types + else + @sites = Type.find(params[:type_id]).sites # path: /types/id/sites + end + respond_to do |format| + format.html # index.html.erb + format.json { render json: @sites } + end + end + + # GET /sites/1 + # GET /sites/1.json + def show + @site = Site.find(params[:id]) + @comments = Site.find(params[:id]).comments + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @site } + end + end + + # GET /sites/new + # GET /sites/new.json + def new + @site = current_user.sites.build # crea sitio vacio asociado a current_user + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @site } + end + end + + # GET /sites/1/edit + def edit + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + end + + # POST /sites + # POST /sites.json + def create + @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user + + respond_to do |format| + if @site.save + format.html { redirect_to @site, notice: 'Site was successfully created.' } + format.json { render json: @site, status: :created, location: @site } + else + format.html { render action: "new" } + format.json { render json: @site.errors, status: :unprocessable_entity } + end + end + end + + # PUT /sites/1 + # PUT /sites/1.json + def update + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + + respond_to do |format| + if @site.update_attributes(params[:site]) + format.html { redirect_to @site, notice: 'Site was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @site.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /sites/1 + # DELETE /sites/1.json + def destroy + @site = current_user.sites.find(params[:id]) # busca solo en sitios asociados a current_user + @site.destroy + + respond_to do |format| + format.html { redirect_to sites_url } + format.json { head :no_content } + end + end + + private + def count_visita + @site.increment!(:visitas) + end +end diff --git a/app/views/comments/_form.html.erb~ b/app/views/comments/_form.html.erb~ index c130af3..6f02051 100644 --- a/app/views/comments/_form.html.erb~ +++ b/app/views/comments/_form.html.erb~ @@ -15,15 +15,15 @@ <%= f.label :comment %>
<%= f.text_area :comment %> -

- <%= f.label :user_id %>
- <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %> + <%= f.label :site_id %>
+<%= select_tag(:site_id, '...') %>
- <%= f.label :site_id %>
- <%= f.number_field :site_id %> + <%= f.label :user_id %>
+ <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %>
+
<%= f.submit %>
diff --git a/app/views/comments/index.html.erb~ b/app/views/comments/index.html.erb~ index 0608eb2..4532517 100644 --- a/app/views/comments/index.html.erb~ +++ b/app/views/comments/index.html.erb~ @@ -17,13 +17,11 @@ <%= link_to 'Show', comment %> <% if comment.user == current_user %> - <%= link_to 'Edit', edit_comment_path(comment) %> <%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %> <% end %> <% end %> -
diff --git a/app/views/sites/_form.html.erb b/app/views/sites/_form.html.erb index f1fd754..46d9320 100644 --- a/app/views/sites/_form.html.erb +++ b/app/views/sites/_form.html.erb @@ -1,3 +1,29 @@ + + + <%= form_for(@site) do |f| %> <% if @site.errors.any? %>
@@ -26,6 +52,18 @@
<%= f.label :image %>
<%= f.file_field :image %> +
+
+ <%= f.label :longuitud %>
+ <%= f.text_field :longuitud %> +
+
+ <%= f.label :latitud %>
+ <%= f.text_field :latitud %> +
+
+ <%= f.label :zoom %>
+ <%= f.text_field :zoom %>
<%= f.submit %> diff --git a/app/views/sites/_form.html.erb~ b/app/views/sites/_form.html.erb~ new file mode 100644 index 0000000..46d9320 --- /dev/null +++ b/app/views/sites/_form.html.erb~ @@ -0,0 +1,71 @@ + + + +<%= 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.label :longuitud %>
+ <%= f.text_field :longuitud %> +
+
+ <%= f.label :latitud %>
+ <%= f.text_field :latitud %> +
+
+ <%= f.label :zoom %>
+ <%= f.text_field :zoom %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/sites/_formedit.html.erb b/app/views/sites/_formedit.html.erb new file mode 100644 index 0000000..d5a0845 --- /dev/null +++ b/app/views/sites/_formedit.html.erb @@ -0,0 +1,45 @@ +<%= 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.label :longuitud %>
+ <%= f.text_field :longuitud %> +
+
+ <%= f.label :latitud %>
+ <%= f.text_field :latitud %> +
+
+ <%= f.label :zoom %>
+ <%= f.text_field :zoom %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/sites/_formedit.html.erb~ b/app/views/sites/_formedit.html.erb~ new file mode 100644 index 0000000..e69de29 diff --git a/app/views/sites/_geomapa.html.erb b/app/views/sites/_geomapa.html.erb new file mode 100644 index 0000000..caf6d2e --- /dev/null +++ b/app/views/sites/_geomapa.html.erb @@ -0,0 +1,51 @@ + + + + + +

Buscando su localización...

+
+ + diff --git a/app/views/sites/_geomapa~ b/app/views/sites/_geomapa~ new file mode 100644 index 0000000..e69de29 diff --git a/app/views/sites/edit.html.erb b/app/views/sites/edit.html.erb index d46384f..ae2792b 100644 --- a/app/views/sites/edit.html.erb +++ b/app/views/sites/edit.html.erb @@ -1,6 +1,6 @@

Editing site

-<%= render 'form' %> +<%= render 'formedit' %> <%= link_to 'Show', @site %> | <%= link_to 'Back', sites_path %> diff --git a/app/views/sites/edit.html.erb~ b/app/views/sites/edit.html.erb~ new file mode 100644 index 0000000..d46384f --- /dev/null +++ b/app/views/sites/edit.html.erb~ @@ -0,0 +1,6 @@ +

Editing site

+ +<%= render 'form' %> + +<%= link_to 'Show', @site %> | +<%= link_to 'Back', sites_path %> diff --git a/app/views/sites/index.html.erb b/app/views/sites/index.html.erb index 9052504..99e93a2 100644 --- a/app/views/sites/index.html.erb +++ b/app/views/sites/index.html.erb @@ -14,6 +14,7 @@
<%= link_to site.name, site %>
<%= truncate(strip_tags(site.description), :length => 80) %>
+
Numero de viajes en los que aparece: <%= site.trips.size %>
<% if site.comments!=[] %>
<%= link_to 'Comentarios', site_comments_path(site) %>
<% end %> diff --git a/app/views/sites/index.html.erb~ b/app/views/sites/index.html.erb~ index b8c87ba..9052504 100644 --- a/app/views/sites/index.html.erb~ +++ b/app/views/sites/index.html.erb~ @@ -14,8 +14,9 @@
<%= link_to site.name, site %>
<%= truncate(strip_tags(site.description), :length => 80) %>
- +<% if site.comments!=[] %>
<%= link_to 'Comentarios', site_comments_path(site) %>
+<% end %> diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 9e9dfb7..299a65a 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -22,6 +22,9 @@ <% end %> <% end %> + + <%= render 'geomapa' %> +

Numero de viajes en los que aparece: <%= @site.trips.size %>

Añada su comentario:

<%= link_to 'Click aqui', new_comment_path %>

Autor: diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ index c9aeabd..26a741b 100644 --- a/app/views/sites/show.html.erb~ +++ b/app/views/sites/show.html.erb~ @@ -7,7 +7,7 @@

<%= @site.name %>

<%=sanitize @site.description %>

- +<% if @site.comments!=[] %>

Comentarios:

<% @site.comments.each do |comment| %> @@ -21,6 +21,10 @@ <% end %>
+<% end %> + + <%= render 'geomapa' %> +

Añada su comentario:

<%= link_to 'Click aqui', new_comment_path %>

Autor: diff --git a/app/views/trips/_mapa.html.erb b/app/views/trips/_mapa.html.erb new file mode 100644 index 0000000..221d99c --- /dev/null +++ b/app/views/trips/_mapa.html.erb @@ -0,0 +1,62 @@ + + + + +

Buscando su localización...

+
+ diff --git a/app/views/trips/_mapa.html.erb~ b/app/views/trips/_mapa.html.erb~ new file mode 100644 index 0000000..139597f --- /dev/null +++ b/app/views/trips/_mapa.html.erb~ @@ -0,0 +1,2 @@ + + diff --git a/app/views/trips/show.html.erb b/app/views/trips/show.html.erb index 8bced6a..4ceed5d 100644 --- a/app/views/trips/show.html.erb +++ b/app/views/trips/show.html.erb @@ -1,28 +1 @@ -

Name: <%= @trip.name %>

Date: <%= @trip.date %>

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

-

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

-
- -

Sitios a visitar

- - <%= render(@trip) %> - - <% if @trip.user == current_user %> - <%= form_for(@visit, :remote => true) do |f| %> - - <%= f.number_field :trip_id, :value => @trip.id, :hidden => true %> - <%= f.collection_select(:site_id, - Site.all, - :id, - :name) %> - <%= f.select(:hour, Array.new(24, 0).fill {|i| [(i.to_s + 'H'), i]}) %> - <%= f.submit "Añadir sitio" %> - <% end %> - <% end %> -
- -
- - <% if @trip.user == current_user %> <%= link_to 'Edit', edit_trip_path(@trip) %> | <% end %> <%= link_to 'Back', trips_path %> - \ No newline at end of file +

Name: <%= @trip.name %>

Date: <%= @trip.date %>

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

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

Sitios a visitar

<%= render(@trip) %> <% if @trip.user == current_user %> <%= form_for(@visit, :remote => true) do |f| %> <%= f.number_field :trip_id, :value => @trip.id, :hidden => true %> <%= f.collection_select(:site_id, Site.all, :id, :name) %> <%= f.select(:hour, Array.new(24, 0).fill {|i| [(i.to_s + 'H'), i]}) %> <%= f.submit "Añadir sitio" %> <% end %> <% end %>

Mapa del viaje:

<%= render 'mapa' %>

<% if @trip.user == current_user %> <%= link_to 'Edit', edit_trip_path(@trip) %> | <% end %> <%= link_to 'Back', trips_path %> \ No newline at end of file diff --git a/app/views/trips/show.html.erb~ b/app/views/trips/show.html.erb~ new file mode 100644 index 0000000..8bced6a --- /dev/null +++ b/app/views/trips/show.html.erb~ @@ -0,0 +1,28 @@ +

Name: <%= @trip.name %>

Date: <%= @trip.date %>

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

+

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

+
+ +

Sitios a visitar

+ + <%= render(@trip) %> + + <% if @trip.user == current_user %> + <%= form_for(@visit, :remote => true) do |f| %> + + <%= f.number_field :trip_id, :value => @trip.id, :hidden => true %> + <%= f.collection_select(:site_id, + Site.all, + :id, + :name) %> + <%= f.select(:hour, Array.new(24, 0).fill {|i| [(i.to_s + 'H'), i]}) %> + <%= f.submit "Añadir sitio" %> + <% end %> + <% end %> +
+ +
+ + <% if @trip.user == current_user %> <%= link_to 'Edit', edit_trip_path(@trip) %> | <% end %> <%= link_to 'Back', trips_path %> + \ No newline at end of file diff --git a/db/migrate/20120425084533_site_geolocalizacion.rb b/db/migrate/20120425084533_site_geolocalizacion.rb new file mode 100644 index 0000000..57bfe3d --- /dev/null +++ b/db/migrate/20120425084533_site_geolocalizacion.rb @@ -0,0 +1,17 @@ +class SiteGeolocalizacion < ActiveRecord::Migration + def up + change_table :sites do |t| #añade las columnas de longuitud, latitud y zom a la tabla sites + t.column :longuitud, :float + t.column :latitud, :float + t.column :zoom, :integer + end + end + + def down + change_table :sites do |t| + t.remove :longuitud, :float + t.remove :latitud, :float + t.remove :zoom, :integer + end + end +end diff --git a/db/migrate/20120425084533_site_geolocalizacion.rb~ b/db/migrate/20120425084533_site_geolocalizacion.rb~ new file mode 100644 index 0000000..93beafd --- /dev/null +++ b/db/migrate/20120425084533_site_geolocalizacion.rb~ @@ -0,0 +1,7 @@ +class SiteGeolocalizacion < ActiveRecord::Migration + def up + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 58db2f7..24ca973 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 => 20120424164523) do +ActiveRecord::Schema.define(:version => 20120425084533) do create_table "comments", :force => true do |t| t.string "comment" @@ -34,6 +34,9 @@ t.string "image_file_size" t.datetime "image_updated_at" t.integer "visitas", :default => 0 + t.float "longuitud" + t.float "latitud" + t.integer "zoom" end create_table "trips", :force => true do |t| diff --git a/db/seeds.rb b/db/seeds.rb index 2bda1ab..210fcd6 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -25,16 +25,16 @@ User.delete_all user1 = User.create!( - name: 'Jose Perez', - email: 'jose.perez@gmail.com', - password: 'perez22', - password_confirmation: 'perez22') + name: 'Fernando Valdenebro', + email: 'fer.kmk@gmail.com', + password: '123456', + password_confirmation: '123456') user2 = User.create!( - name: 'Javier Sedano', - email: 'javier.sedano@me.com', - password: 'sedano22', - password_confirmation: 'sedano22') + name: 'Antonio Turel', + email: 'toni@me.com', + password: '123456', + password_confirmation: '123456') Site.delete_all diff --git a/db/seeds.rb~ b/db/seeds.rb~ new file mode 100644 index 0000000..2bda1ab --- /dev/null +++ b/db/seeds.rb~ @@ -0,0 +1,117 @@ +# This file should contain all the record creation needed to seed the +# database with its default values. The data can then be loaded with +# the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) +# Mayor.create(name: 'Emanuel', city: cities.first) + +Type.delete_all + +type1 = Type.create!( + name: 'Monumento', + description: 'Edificio de interes turistico o artistico') + +type2 = Type.create!( + name: 'Naturaleza', + description: 'Lugar al aire libre de interes natural o de recreo') + +type3 = Type.create!( + name: 'Ruina', + description: 'Lugar o resto de interes arquelogico') + + +User.delete_all + +user1 = User.create!( + name: 'Jose Perez', + email: 'jose.perez@gmail.com', + password: 'perez22', + password_confirmation: 'perez22') + +user2 = User.create!( + name: 'Javier Sedano', + email: 'javier.sedano@me.com', + password: 'sedano22', + password_confirmation: 'sedano22') + + +Site.delete_all + +site1= Site.create!( + name: 'Pedriza', + description: 'Magnifico valle al norte de Madrid en el Macizo Central', + type_id: type2.id, + image_url: 'pedriza.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pedriza.png'), "r")) +site1.user_id = user1.id ; site1.save + +site2 = Site.create!( + name: 'Catedral de Florencia', + description: 'Catedral de la ciudad de Florencia con la que se inicia el Renacimiento', + type_id: type1.id, + image_url: 'florencia.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'florencia.png'), "r")) +site2.user_id = user1.id ; site2.save + +site3 = Site.create!( + name: 'Jardin de Lineo', + description: 'Jardin de la ciudad sueca de Uppsala donde el famoso naturalista tenia su coleccion de plantas', + type_id: type1.id, + image_url: 'arbol1.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'arbol1.png'), "r")) +site3.user_id = user2.id ; site3.save + +site4 = Site.create!( + name: 'Reichstag', + description: 'Parlamento aleman en la ciudad de Berlin', + type_id: type2.id, + image_url: 'reichstag.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'reichstag.png'), "r")) +site4.user_id = user2.id ; site4.save + +site5 = Site.create!( + name: 'Pergamo', + description: 'Puerta del mercado de la antigua ciudad griega de Pergamo del museo arquelogico de Berlin', + type_id: type3.id, + image_url: 'pergamo.png', + image: File.open(File.join(Rails.root, 'app', 'assets','images', 'pergamo.png'), "r")) +site5.user_id = user1.id ; site5.save + + + +Trip.delete_all + +trip1 = Trip.create!( + name: 'Viaje por Europa', + description: 'Viaje por capitales europeas', + date: '2012-04-12') +trip1.user_id = user1.id ; trip1.save + +trip2 = Trip.create!( + name: 'Sierra de Madrid', + description: 'Sua al Yelmo en la Pedriza', + date: '2012-05-18') +trip2.user_id = user2.id ; trip2.save + + +Visit.delete_all + +visit1 = Visit.create!( + hour: '10') +visit1.trip_id = trip2.id +visit1.site_id = site1.id ; visit1.save + +visit2 = Visit.create!( + hour: '9') +visit2.trip_id = trip1.id +visit2.site_id = site5.id ; visit2.save + +visit3 = Visit.create!( + hour: '16') +visit3.trip_id = trip1.id +visit3.site_id = site4.id ; visit3.save + + + From e896539498d1a5ded93998696b3b65ef55519826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Wed, 25 Apr 2012 17:58:45 +0200 Subject: [PATCH 4/7] =?UTF-8?q?A=C3=B1adida=20busqueda=20de=20sitios=20y?= =?UTF-8?q?=20viajes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/planet.css | 5 + app/assets/stylesheets/planet.css~ | 169 ++++++++++++++++++++++++ app/controllers/planet_controller.rb | 10 ++ app/controllers/planet_controller.rb~ | 3 + app/views/layouts/application.html.erb | 6 + app/views/layouts/application.html.erb~ | 10 +- app/views/planet/search.html.erb | 27 ++++ app/views/planet/search.html.erb~ | 0 config/routes.rb | 2 + config/routes.rb~ | 4 + 10 files changed, 234 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/planet.css~ create mode 100644 app/views/planet/search.html.erb create mode 100644 app/views/planet/search.html.erb~ diff --git a/app/assets/stylesheets/planet.css b/app/assets/stylesheets/planet.css index ead053a..39ec426 100644 --- a/app/assets/stylesheets/planet.css +++ b/app/assets/stylesheets/planet.css @@ -93,6 +93,11 @@ background: #446; } +#bs{ +margin-top: 2em; +width: 86px; +} + #main { margin-left: 9em; /* Ajuste de borde izquierdo */ padding-top: 4ex; diff --git a/app/assets/stylesheets/planet.css~ b/app/assets/stylesheets/planet.css~ new file mode 100644 index 0000000..ead053a --- /dev/null +++ b/app/assets/stylesheets/planet.css~ @@ -0,0 +1,169 @@ +/* Global styles (no utilizados de momento) */ + +#planet #notice { + color: #000; + border: 2px solid red; + padding: 1em; + margin-bottom: 2em; + background-color: #f0f0f0; + font: bold smaller sans-serif; +} + + +#planet h1 { + font: 150% sans-serif; + color: #226; + border-bottom: 3px dotted #77d; +} + +/* Styles for products/index */ + +#site_list table { + border-collapse: collapse; +} + +#site_list table tr td { + padding: 5px; + vertical-align: top; +} + +#site_list .list_image { + width: 60px; + height: 70px; +} + +#site_list .list_description { + width: 60%; +} + +#site_list .list_description dl { + margin: 0; +} + +#site_list .list_description dt { + color: #244; + font-weight: bold; + font-size: larger; +} + +#site_list .list_description dd { + margin: 0; +} + +#site_list .list_actions { + font-size: x-small; + text-align: right; + padding-left: 1em; +} + +#site_list .list_line_even { + background: #a8b8f8; +} + +#site_list .list_line_odd { + background: #88b0f8; +} + + +/* START:mainlayout */ +/* Styles for main page */ + +#banner { + background: #668; + padding-top: 10px; + padding-bottom: 10px; + border-bottom: 2px solid; + font: small-caps 40px/40px "Times New Roman", serif; + color: #bfb; + text-align: center; +} + +#banner img { + float: left; + padding-left: 10px; +} + +#banner .user { + float: right; + color: #bfb; + font-size: small; +} + +#columns { + background: #446; +} + +#main { + margin-left: 9em; /* Ajuste de borde izquierdo */ + padding-top: 4ex; + padding-left: 2em; + background: white; +} + +#side { + float: left; + padding-top: 1em; + padding-left: 1em; + padding-bottom: 1em; + width: 8em; /* Ajuste de borde izquierdo */ + background: #446; +} + +#side a { + color: #bfb; + font-size: small; +} +/* END:mainlayout */ + +/* An entry in the store catalog (no utilizados de momento) */ + +#planet .entry { + overflow: auto; + margin-top: 1em; + border-bottom: 1px dotted #77d; +} + +#planet .name { + font-size: 120%; + font-family: sans-serif; +} + +#store .entry img { + width: 80px; + margin-right: 5px; + margin-bottom: 5px; + float: left; +} + + +#store .entry h3 { + margin-top: 0; + margin-bottom: 2px; + color: #227; +} + +#store .entry p { + margin-top: 0.5em; + margin-bottom: 0.8em; +} + +#store .entry .price_line { + clear: both; + margin-bottom: 0.5em; +} + +#store .entry .add_to_cart { + position: relative; +} + +#store .entry .price { + color: #44a; + font-weight: bold; + margin-right: 2em; +} + + +#main .visitas { + text-indent: 70%; +} + diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index 9eb2fe9..1ee4fc5 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -32,5 +32,15 @@ def ejemplo # Acción author def author end + + def search + if params[:query].empty? or params[:query].length < 3 + @sites = [] + @trips = [] + else + @sites = Site.where("name like ? or description like ?", "%"+params[:query]+"%", "%"+params[:query]+"%") + @trips = Trip.where("name like ? or description like ?", "%"+params[:query]+"%", "%"+params[:query]+"%") + end + end end diff --git a/app/controllers/planet_controller.rb~ b/app/controllers/planet_controller.rb~ index a8636bd..9eb2fe9 100644 --- a/app/controllers/planet_controller.rb~ +++ b/app/controllers/planet_controller.rb~ @@ -29,5 +29,8 @@ class PlanetController < ApplicationController # Método que define una acción vacía del controlador def ejemplo end + # Acción author + def author + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8cb93f7..9d67e03 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -36,6 +36,12 @@ <%= link_to "Viajes", trips_path %>
<%= link_to "Contact", planet_contact_path %>
<%= link_to "Sign up", new_user_registration_path unless current_user %> +
+
+ + +
+

<%= notice %>

<%= alert %>

diff --git a/app/views/layouts/application.html.erb~ b/app/views/layouts/application.html.erb~ index acda53b..fc9ed7d 100644 --- a/app/views/layouts/application.html.erb~ +++ b/app/views/layouts/application.html.erb~ @@ -36,14 +36,20 @@ <%= link_to "Viajes", trips_path %>
<%= link_to "Contact", planet_contact_path %>
<%= link_to "Sign up", new_user_registration_path unless current_user %> + +
+ + +
+

<%= notice %>

<%= alert %>

-<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', ordered_index_type_path) %> +<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', types_ordered_index_path) %> <%= yield %>
-<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', ordered_index_type_path) %> +<%= link_to('Home', planet_index_path) + "|" + link_to('Contacts', planet_contact_path) + "|" + link_to('Ejemplo', planet_ejemplo_path) + "|" + link_to('Author', planet_author_path) + "|" + link_to('Tipos', types_path) + "|" + link_to('Sitios', sites_path) + "|" + link_to('Tipos_ordenados', types_ordered_index_path) %>
diff --git a/app/views/planet/search.html.erb b/app/views/planet/search.html.erb new file mode 100644 index 0000000..be9644a --- /dev/null +++ b/app/views/planet/search.html.erb @@ -0,0 +1,27 @@ +

Sitios encontrados

+<% if @sites.empty? %> + No hay resultados

+ +<% else %> + + <% @sites.each do |site| %> +
  • Name:<%= site.name %>, Descripción: <%= site.description %>
  • + + <% end %> + +<% end %> + +

    Viajes encontrados

    +<% if @trips.empty? %> + No hay resultados

    + +<% else %> + + <% @trips.each do |trip| %> +
    +
  • Name: <%= trip.name %>, Descriptión: <%= trip.description %>
  • +
    + + <% end %> + +<% end %> diff --git a/app/views/planet/search.html.erb~ b/app/views/planet/search.html.erb~ new file mode 100644 index 0000000..e69de29 diff --git a/config/routes.rb b/config/routes.rb index acddb7d..df475dc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,6 +27,8 @@ get "planet/ejemplo" + get "planet/search" + # The priority is based upon order of creation: # first created -> highest priority. diff --git a/config/routes.rb~ b/config/routes.rb~ index 1add910..acddb7d 100644 --- a/config/routes.rb~ +++ b/config/routes.rb~ @@ -16,6 +16,10 @@ Planet::Application.routes.draw do resources :types do # Rutas anidadas /types/id/sites..., resources :sites, :only => [ :index ] # Restringe a acción “index” end + + resources :sites do # Rutas anidadas /sites/id/comments..., + resources :comments, :only => [ :index ] # Restringe a acción “index” + end get "planet/index" From 54869717d4ed7ee3d59019480b3f39c6d1571eb7 Mon Sep 17 00:00:00 2001 From: "Antonio J. Turel" Date: Thu, 26 Apr 2012 13:37:51 +0200 Subject: [PATCH 5/7] =?UTF-8?q?A=C3=B1adida=20documentaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 +- Gemfile.lock | 5 + app/assets/images/favicon.ico | Bin 0 -> 1150 bytes app/assets/stylesheets/planet.css | 4 + app/controllers/application_controller.rb | 3 + app/controllers/comments_controller.rb | 10 + app/controllers/planet_controller.rb | 13 +- app/controllers/sites_controller.rb | 18 +- app/controllers/trips_controller.rb | 10 + app/controllers/types_controller.rb | 10 + app/controllers/visits_controller.rb | 10 + app/helpers/application_helper.rb | 2 + app/helpers/comments_helper.rb | 2 + app/helpers/planet_helper.rb | 2 + app/helpers/sites_helper.rb | 2 + app/helpers/trips_helper.rb | 2 + app/helpers/types_helper.rb | 2 + app/helpers/visits_helper.rb | 2 + app/models/comment.rb | 8 + app/models/site.rb | 11 + app/models/trip.rb | 9 + app/models/type.rb | 7 + app/models/user.rb | 9 + app/models/visit.rb | 8 + app/views/layouts/application.html.erb | 14 +- app/views/planet/search.html.erb | 1 - app/views/planet/search.html.erb~ | 27 + doc/app/ApplicationController.html | 12 + doc/app/ApplicationHelper.html | 11 + doc/app/Comment.html | 180 +++++++ doc/app/CommentsController.html | 467 +++++++++++++++++ doc/app/CommentsHelper.html | 162 ++++++ doc/app/PlanetController.html | 81 ++- doc/app/PlanetHelper.html | 11 + doc/app/Site.html | 32 ++ doc/app/SitesController.html | 43 +- doc/app/SitesHelper.html | 11 + doc/app/Trip.html | 26 + doc/app/TripsController.html | 41 +- doc/app/TripsHelper.html | 11 + doc/app/Type.html | 20 + doc/app/TypesController.html | 83 ++- doc/app/TypesHelper.html | 11 + doc/app/User.html | 23 + doc/app/Visit.html | 23 + doc/app/VisitsController.html | 41 +- doc/app/VisitsHelper.html | 11 + doc/app/created.rid | 41 +- doc/app/doc/README_FOR_APP.html | 6 + doc/app/index.html | 6 + doc/app/js/search_index.js | 2 +- doc/app/table_of_contents.html | 113 +++- public/025/favicon.ico | Bin 0 -> 1150 bytes public/app/ApplicationController.html | 169 ++++++ public/app/ApplicationHelper.html | 162 ++++++ public/app/Comment.html | 180 +++++++ public/app/CommentsController.html | 467 +++++++++++++++++ public/app/CommentsHelper.html | 162 ++++++ public/app/PlanetController.html | 375 ++++++++++++++ public/app/PlanetHelper.html | 162 ++++++ public/app/Site.html | 189 +++++++ public/app/SitesController.html | 468 +++++++++++++++++ public/app/SitesHelper.html | 162 ++++++ public/app/Trip.html | 183 +++++++ public/app/TripsController.html | 464 +++++++++++++++++ public/app/TripsHelper.html | 162 ++++++ public/app/Type.html | 177 +++++++ public/app/TypesController.html | 499 ++++++++++++++++++ public/app/TypesHelper.html | 162 ++++++ public/app/User.html | 180 +++++++ public/app/Visit.html | 180 +++++++ public/app/VisitsController.html | 464 +++++++++++++++++ public/app/VisitsHelper.html | 162 ++++++ public/app/created.rid | 22 + public/app/doc/README_FOR_APP.html | 123 +++++ public/app/images/add.png | Bin 0 -> 733 bytes public/app/images/brick.png | Bin 0 -> 452 bytes public/app/images/brick_link.png | Bin 0 -> 764 bytes public/app/images/bug.png | Bin 0 -> 774 bytes public/app/images/bullet_black.png | Bin 0 -> 211 bytes public/app/images/bullet_toggle_minus.png | Bin 0 -> 207 bytes public/app/images/bullet_toggle_plus.png | Bin 0 -> 209 bytes public/app/images/date.png | Bin 0 -> 626 bytes public/app/images/delete.png | Bin 0 -> 715 bytes public/app/images/find.png | Bin 0 -> 659 bytes public/app/images/loadingAnimation.gif | Bin 0 -> 5886 bytes public/app/images/macFFBgHack.png | Bin 0 -> 207 bytes public/app/images/package.png | Bin 0 -> 853 bytes public/app/images/page_green.png | Bin 0 -> 621 bytes public/app/images/page_white_text.png | Bin 0 -> 342 bytes public/app/images/page_white_width.png | Bin 0 -> 309 bytes public/app/images/plugin.png | Bin 0 -> 591 bytes public/app/images/ruby.png | Bin 0 -> 592 bytes public/app/images/tag_blue.png | Bin 0 -> 1880 bytes public/app/images/tag_green.png | Bin 0 -> 613 bytes public/app/images/transparent.png | Bin 0 -> 97 bytes public/app/images/wrench.png | Bin 0 -> 610 bytes public/app/images/wrench_orange.png | Bin 0 -> 584 bytes public/app/images/zoom.png | Bin 0 -> 692 bytes public/app/index.html | 116 +++++ public/app/js/darkfish.js | 153 ++++++ public/app/js/jquery.js | 18 + public/app/js/navigation.js | 142 +++++ public/app/js/search.js | 94 ++++ public/app/js/search_index.js | 1 + public/app/js/searcher.js | 228 ++++++++ public/app/rdoc.css | 543 ++++++++++++++++++++ public/app/table_of_contents.html | 257 +++++++++ test/fixtures/.gitkeep | 0 test/fixtures/comments.yml | 0 test/fixtures/sites.yml | 0 test/fixtures/trips.yml | 0 test/fixtures/types.yml | 0 test/fixtures/users.yml | 0 test/fixtures/visits.yml | 0 test/functional/.gitkeep | 0 test/functional/comments_controller_test.rb | 0 test/functional/planet_controller_test.rb | 0 test/functional/planet_controller_test.rb~ | 0 test/functional/sites_controller_test.rb | 0 test/functional/trips_controller_test.rb | 0 test/functional/types_controller_test.rb | 0 test/functional/visits_controller_test.rb | 0 test/integration/.gitkeep | 0 test/performance/browsing_test.rb | 0 test/test_helper.rb | 0 test/unit/.gitkeep | 0 test/unit/comment_test.rb | 0 test/unit/helpers/comments_helper_test.rb | 0 test/unit/helpers/planet_helper_test.rb | 0 test/unit/helpers/sites_helper_test.rb | 0 test/unit/helpers/trips_helper_test.rb | 0 test/unit/helpers/types_helper_test.rb | 0 test/unit/helpers/visits_helper_test.rb | 0 test/unit/site_test.rb | 0 test/unit/trip_test.rb | 0 test/unit/type_test.rb | 0 test/unit/user_test.rb | 0 test/unit/visit_test.rb | 0 139 files changed, 8408 insertions(+), 81 deletions(-) create mode 100644 app/assets/images/favicon.ico create mode 100644 doc/app/Comment.html create mode 100644 doc/app/CommentsController.html create mode 100644 doc/app/CommentsHelper.html create mode 100644 public/025/favicon.ico create mode 100644 public/app/ApplicationController.html create mode 100644 public/app/ApplicationHelper.html create mode 100644 public/app/Comment.html create mode 100644 public/app/CommentsController.html create mode 100644 public/app/CommentsHelper.html create mode 100644 public/app/PlanetController.html create mode 100644 public/app/PlanetHelper.html create mode 100644 public/app/Site.html create mode 100644 public/app/SitesController.html create mode 100644 public/app/SitesHelper.html create mode 100644 public/app/Trip.html create mode 100644 public/app/TripsController.html create mode 100644 public/app/TripsHelper.html create mode 100644 public/app/Type.html create mode 100644 public/app/TypesController.html create mode 100644 public/app/TypesHelper.html create mode 100644 public/app/User.html create mode 100644 public/app/Visit.html create mode 100644 public/app/VisitsController.html create mode 100644 public/app/VisitsHelper.html create mode 100644 public/app/created.rid create mode 100644 public/app/doc/README_FOR_APP.html create mode 100755 public/app/images/add.png create mode 100644 public/app/images/brick.png create mode 100644 public/app/images/brick_link.png create mode 100644 public/app/images/bug.png create mode 100644 public/app/images/bullet_black.png create mode 100644 public/app/images/bullet_toggle_minus.png create mode 100644 public/app/images/bullet_toggle_plus.png create mode 100644 public/app/images/date.png create mode 100755 public/app/images/delete.png create mode 100644 public/app/images/find.png create mode 100644 public/app/images/loadingAnimation.gif create mode 100644 public/app/images/macFFBgHack.png create mode 100644 public/app/images/package.png create mode 100644 public/app/images/page_green.png create mode 100644 public/app/images/page_white_text.png create mode 100644 public/app/images/page_white_width.png create mode 100644 public/app/images/plugin.png create mode 100644 public/app/images/ruby.png create mode 100755 public/app/images/tag_blue.png create mode 100644 public/app/images/tag_green.png create mode 100644 public/app/images/transparent.png create mode 100644 public/app/images/wrench.png create mode 100644 public/app/images/wrench_orange.png create mode 100644 public/app/images/zoom.png create mode 100644 public/app/index.html create mode 100644 public/app/js/darkfish.js create mode 100644 public/app/js/jquery.js create mode 100644 public/app/js/navigation.js create mode 100644 public/app/js/search.js create mode 100644 public/app/js/search_index.js create mode 100644 public/app/js/searcher.js create mode 100644 public/app/rdoc.css create mode 100644 public/app/table_of_contents.html mode change 100644 => 100755 test/fixtures/.gitkeep mode change 100644 => 100755 test/fixtures/comments.yml mode change 100644 => 100755 test/fixtures/sites.yml mode change 100644 => 100755 test/fixtures/trips.yml mode change 100644 => 100755 test/fixtures/types.yml mode change 100644 => 100755 test/fixtures/users.yml mode change 100644 => 100755 test/fixtures/visits.yml mode change 100644 => 100755 test/functional/.gitkeep mode change 100644 => 100755 test/functional/comments_controller_test.rb mode change 100644 => 100755 test/functional/planet_controller_test.rb mode change 100644 => 100755 test/functional/planet_controller_test.rb~ mode change 100644 => 100755 test/functional/sites_controller_test.rb mode change 100644 => 100755 test/functional/trips_controller_test.rb mode change 100644 => 100755 test/functional/types_controller_test.rb mode change 100644 => 100755 test/functional/visits_controller_test.rb mode change 100644 => 100755 test/integration/.gitkeep mode change 100644 => 100755 test/performance/browsing_test.rb mode change 100644 => 100755 test/test_helper.rb mode change 100644 => 100755 test/unit/.gitkeep mode change 100644 => 100755 test/unit/comment_test.rb mode change 100644 => 100755 test/unit/helpers/comments_helper_test.rb mode change 100644 => 100755 test/unit/helpers/planet_helper_test.rb mode change 100644 => 100755 test/unit/helpers/sites_helper_test.rb mode change 100644 => 100755 test/unit/helpers/trips_helper_test.rb mode change 100644 => 100755 test/unit/helpers/types_helper_test.rb mode change 100644 => 100755 test/unit/helpers/visits_helper_test.rb mode change 100644 => 100755 test/unit/site_test.rb mode change 100644 => 100755 test/unit/trip_test.rb mode change 100644 => 100755 test/unit/type_test.rb mode change 100644 => 100755 test/unit/user_test.rb mode change 100644 => 100755 test/unit/visit_test.rb diff --git a/Gemfile b/Gemfile index 321d59d..6c09448 100644 --- a/Gemfile +++ b/Gemfile @@ -2,8 +2,8 @@ source 'https://rubygems.org' gem 'rails', '3.2.2' -#gem 'execjs' -#gem 'therubyracer' + gem 'execjs' + gem 'therubyracer' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index da265f4..f11e3d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -55,6 +55,7 @@ GEM railties (>= 3.2.0, < 5.0) thor (~> 0.14) json (1.6.6) + libv8 (3.3.10.4) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -104,6 +105,8 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.6) + therubyracer (0.10.1) + libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) @@ -123,9 +126,11 @@ DEPENDENCIES cleditor_rails coffee-rails (~> 3.2.1) devise + execjs jquery-rails paperclip rails (= 3.2.2) sass-rails (~> 3.2.3) sqlite3 + therubyracer uglifier (>= 1.0.3) diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2536afac13639b72df2391cd609231dc550ceeed GIT binary patch literal 1150 zcmb7^%WoT16vhXMKcFktELebqKw<+s79bX^5iEcO65`QRN>!yGR0OS1g+z<0rb2DW zLkY@*)Nz`mEv;JII*p6tG&S)%c5KHJXZ#pHXU2Bg)vxDHM8S^MTiO?yexv{waU63Y|2ESe_Ip8XiL8b#A|u_vp-m4y@hee7-S&i%mR z@E3T0d6!^d7DJvX^!+OJI-Q3PvG(_A2{NTT|AZGgw{VbOXNH&<`HbP|?-`q)AeIc0 zHS%}SY?8;aCw0MfoCkqUEvkcDV_;h@WPeu!zTpnV^H%cgRhfv0c z-ptYy{dg&b=fN~TULC-5f0EF4mgP{2jA?T(p_8uK;_KiG-zHbdGIn!-8UJ@otsbK8 z)KU6NNiTo;hlv#9?6n;NkvMIsN3LjKS{AKd5C8u$j8+xz`bi?WFv(&7tLIQ^*O^`$ zXX5sG>KzBe>adpFk{Wf$8)b}ogJ!o!Af9$(s#q)GAffoCd;ip4no-eSzCZ8Qq-+a6 zk#hHnzgMffdw(S5@=Gm)k$=Bt>dp}gl`Se(n~N*IGZ&nqYT5jkHVACS<=zg7><)!e z)!onEi%7m5cB*+U+!!QQSa*BZlzT2cxXh$~gmSBm(X@yc461FLNGc=x4NTi%yHsP> zY!KYK#@Xe=M7MPuslOxhvm&!`DL5ywOHXp_c1iE#ML#DsFi016Tzf<8H^LK4`hG?? z^Qif;gl{?y>9S5J8+QF_a=sf{#}^24?Us*lGD)+y&xXD#^*`(0&6fW3`D%U@ni5}W z_$B98yguHV4fE#p4L-c?mp*r-KepRT}bi<*WF% q@cU==4yrsG-F>Nb6VGaf#BPPM^r9j5mY}b%d^^H__W$5{&yN8Fa(K7^ literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/planet.css b/app/assets/stylesheets/planet.css index 39ec426..5eec4d0 100644 --- a/app/assets/stylesheets/planet.css +++ b/app/assets/stylesheets/planet.css @@ -93,6 +93,10 @@ background: #446; } +#subirArriba { + float: right; +} + #bs{ margin-top: 2em; width: 86px; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8065d9..ac9622a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,6 @@ +# == En esta clase +# [clase ApplicationController] Definimos instrucción para posibles ataques al servidor. class ApplicationController < ActionController::Base + protect_from_forgery end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 61d4405..52c24e3 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,3 +1,13 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a comentarios, la ruta determina qué controlador y acción realizar. +# == Métodos para controlador comentarios +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy class CommentsController < ApplicationController # GET /comments # GET /comments.json diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index 1ee4fc5..3af0790 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -32,15 +32,18 @@ def ejemplo # Acción author def author end - + # Método que define la búsqueda de palabras a encontrar en la aplicación def search - if params[:query].empty? or params[:query].length < 3 + if params[:busqueda].empty? or params[:busqueda].length < 3 @sites = [] @trips = [] else - @sites = Site.where("name like ? or description like ?", "%"+params[:query]+"%", "%"+params[:query]+"%") - @trips = Trip.where("name like ? or description like ?", "%"+params[:query]+"%", "%"+params[:query]+"%") + @sites = Site.where("name like ? or description like ?", "%"+params[:busqueda]+"%", "%"+params[:busqueda]+"%") + @trips = Trip.where("name like ? or description like ?", "%"+params[:busqueda]+"%", "%"+params[:busqueda]+"%") end end - + + def table_of_contents + end + end diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 57e0611..546a2d7 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -1,3 +1,14 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a sitios, la ruta determina qué controlador y acción realizar. +# == Métodos para controlador sitios +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy +# * count_visita class SitesController < ApplicationController # authenticate_user! ejecuta acción solo si sesión existe @@ -88,9 +99,10 @@ def destroy format.json { head :no_content } end end - - private - def count_visita + +private +# método cuenta visitas para gestionar el incremento de visitas a sitios +def count_visita @site.increment!(:visitas) end end diff --git a/app/controllers/trips_controller.rb b/app/controllers/trips_controller.rb index 321f6e3..25e21bf 100644 --- a/app/controllers/trips_controller.rb +++ b/app/controllers/trips_controller.rb @@ -1,3 +1,13 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a viajes, la ruta determina qué controlador y acción realizar. +# == Métodos para controlador viajes +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy class TripsController < ApplicationController # authenticate_user! ejecuta acción solo si sesión existe diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index d32f3af..1a0545f 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -1,3 +1,13 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a tipos, la ruta determina qué controlador y acción realizar +# == Métodos para controlador tipos +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy class TypesController < ApplicationController # GET /types # GET /types.json diff --git a/app/controllers/visits_controller.rb b/app/controllers/visits_controller.rb index 5bd5366..6b4152c 100644 --- a/app/controllers/visits_controller.rb +++ b/app/controllers/visits_controller.rb @@ -1,3 +1,13 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a visitas, la ruta determina qué controlador y acción realizar +# == Métodos para controlador visitas +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy class VisitsController < ApplicationController # GET /visits # GET /visits.json diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..4ad0de1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para application. module ApplicationHelper end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 0ec9ca5..9d80b98 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para comments. module CommentsHelper end diff --git a/app/helpers/planet_helper.rb b/app/helpers/planet_helper.rb index 5bbc197..9171c64 100644 --- a/app/helpers/planet_helper.rb +++ b/app/helpers/planet_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para planet. module PlanetHelper end diff --git a/app/helpers/sites_helper.rb b/app/helpers/sites_helper.rb index 621069d..2a9d6af 100644 --- a/app/helpers/sites_helper.rb +++ b/app/helpers/sites_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para sites. module SitesHelper end diff --git a/app/helpers/trips_helper.rb b/app/helpers/trips_helper.rb index 04f333d..44e7264 100644 --- a/app/helpers/trips_helper.rb +++ b/app/helpers/trips_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para trips. module TripsHelper end diff --git a/app/helpers/types_helper.rb b/app/helpers/types_helper.rb index 40a2b9e..63024ea 100644 --- a/app/helpers/types_helper.rb +++ b/app/helpers/types_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para types. module TypesHelper end diff --git a/app/helpers/visits_helper.rb b/app/helpers/visits_helper.rb index 8ce5f83..50b5a33 100644 --- a/app/helpers/visits_helper.rb +++ b/app/helpers/visits_helper.rb @@ -1,2 +1,4 @@ +#Rails genera método helper para facilitar la programación de vistas y controladores. +# * En este caso para visits. module VisitsHelper end diff --git a/app/models/comment.rb b/app/models/comment.rb index 392fe83..06aad18 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,3 +1,11 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Comment con relación uno-a-muchos: +# * belongs_to: Comment referencia un objeto Site +# * belongs_to: Comment referencia un objeto User class Comment < ActiveRecord::Base belongs_to :site belongs_to :user diff --git a/app/models/site.rb b/app/models/site.rb index baefe5c..fadec12 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -1,3 +1,14 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Site con relación uno-a-muchos: +# * belongs_to: Site referencia un objeto Type +# * belongs_to: Site referencia un objeto User +# * has_many: un Site referenciado por muchos Visit +# * has_many: un Site referenciado por muchos Trip +# * has_many: un Site referenciado por muchos Comment class Site < ActiveRecord::Base belongs_to :type belongs_to :user diff --git a/app/models/trip.rb b/app/models/trip.rb index 4ff6d83..d93d3ca 100644 --- a/app/models/trip.rb +++ b/app/models/trip.rb @@ -1,3 +1,12 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Trip con relación uno-a-muchos: +# * belongs_to: Trip referencia un objeto User +# * has_many: un Trip referenciado por muchos Visit +# * has_many: un Trip referenciado por muchos Site class Trip < ActiveRecord::Base belongs_to :user has_many :visits diff --git a/app/models/type.rb b/app/models/type.rb index 2284d1f..15e57c4 100644 --- a/app/models/type.rb +++ b/app/models/type.rb @@ -1,3 +1,10 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Type con relación uno-a-muchos: +# * has_many: un Type referenciado por muchos Site class Type < ActiveRecord::Base has_many :sites diff --git a/app/models/user.rb b/app/models/user.rb index 8fc2062..8c02d53 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,12 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Use con relación uno-a-muchos: +# * has_many: un Use referenciado por muchos Site +# * has_many: un Use referenciado por muchos Trip +# * has_many: un Use referenciado por muchos Comment class User < ActiveRecord::Base has_many :sites diff --git a/app/models/visit.rb b/app/models/visit.rb index 57546da..e00a0dd 100644 --- a/app/models/visit.rb +++ b/app/models/visit.rb @@ -1,3 +1,11 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Visit con relación uno-a-muchos: +# * belongs_to: Visit referencia un objeto Trip +# * belongs_to: Visit referencia un objeto Site class Visit < ActiveRecord::Base belongs_to :trip belongs_to :site diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9d67e03..4d576c2 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,7 +5,8 @@ <%= stylesheet_link_tag "application" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> - + + + + + + + + + + + + + + +
    +

    class Comment

    + +
    + +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Comment con relación uno-a-muchos:

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

    class CommentsController

    + +
    + +

    Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a comentarios, la ruta determina +qué controlador y acción realizar.

    + +

    Métodos para controlador comentarios

    +
    • +

      index

      +
    • +

      show

      +
    • +

      new

      +
    • +

      edit

      +
    • +

      create

      +
    • +

      update

      +
    • +

      destroy

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

    Public Instance Methods

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

    POST /comments POST /comments.json

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

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

    + + + +
    +
    # File app/controllers/comments_controller.rb, line 88
    +def destroy
    +  @comment = Comment.find(params[:id])
    +  @comment.destroy
    +
    +  respond_to do |format|
    +    format.html { redirect_to sites_url }
    +    format.json { head :no_content }
    +  end
    +end
    +
    + +
    + + + + +
    + + +
    + +
    + edit() + click to toggle source +
    + + +
    + +

    GET /comments/1/edit

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

    GET /comments GET /comments.json

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

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

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

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

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

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

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

    module CommentsHelper

    + +
    + +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para comments.
    + +
    + + + + +
    + + + + + + + + + + +
    + +
    + + + + diff --git a/doc/app/PlanetController.html b/doc/app/PlanetController.html index e3bde99..10501fd 100644 --- a/doc/app/PlanetController.html +++ b/doc/app/PlanetController.html @@ -70,12 +70,16 @@

    Methods

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

    Class and Module Index

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

    Algunos comandos de formateo

    Public Instance Methods

    +
    + +
    + author() + click to toggle source +
    + + +
    + +

    Acción author

    + + + +
    +
    # 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,42 @@

    Public Instance Methods

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

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -122,6 +128,11 @@

    module PlanetHelper

    +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para planet.
    +
    diff --git a/doc/app/Site.html b/doc/app/Site.html index 3c8b96c..04a398e 100644 --- a/doc/app/Site.html +++ b/doc/app/Site.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -128,6 +134,32 @@

    class Site

    +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Site con relación uno-a-muchos:

    +
    • +

      belongs_to: Site referencia un objeto Type

      +
    • +

      belongs_to: Site referencia un objeto User

      +
    • +

      has_many: un Site referenciado por muchos Visit

      +
    • +

      has_many: un Site referenciado por muchos Trip

      +
    • +

      has_many: un Site referenciado por muchos Comment

      +
    +
    diff --git a/doc/app/SitesController.html b/doc/app/SitesController.html index c02b5c6..e10a2ca 100644 --- a/doc/app/SitesController.html +++ b/doc/app/SitesController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -150,6 +156,29 @@

    class SitesController

    +

    Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a sitios, la ruta determina qué +controlador y acción realizar.

    + +

    Métodos para controlador sitios

    +
    • +

      index

      +
    • +

      show

      +
    • +

      new

      +
    • +

      edit

      +
    • +

      create

      +
    • +

      update

      +
    • +

      destroy

      +
    • +

      count_visita

      +
    +
    @@ -186,7 +215,7 @@

    Public Instance Methods

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

    Public Instance Methods

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

    Public Instance Methods

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

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 9
    +            
    # File app/controllers/sites_controller.rb, line 20
     def index
       if params[:type_id].nil? or params[:type_id].empty?
         @sites = Site.all            # path: /types
    @@ -330,7 +359,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 34
    +            
    # File app/controllers/sites_controller.rb, line 45
     def new
       @site = current_user.sites.build # crea sitio vacio asociado a current_user
       
    @@ -365,7 +394,7 @@ 

    Public Instance Methods

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

    Public Instance Methods

    -
    # File app/controllers/sites_controller.rb, line 66
    +            
    # File app/controllers/sites_controller.rb, line 77
     def update
       @site = current_user.sites.find(params[:id])  # busca solo en sitios asociados a current_user 
       
    diff --git a/doc/app/SitesHelper.html b/doc/app/SitesHelper.html
    index aa932c6..a0e0588 100644
    --- a/doc/app/SitesHelper.html
    +++ b/doc/app/SitesHelper.html
    @@ -81,6 +81,12 @@ 

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -122,6 +128,11 @@

    module SitesHelper

    +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para sites.
    +
    diff --git a/doc/app/Trip.html b/doc/app/Trip.html index 9a51e94..71d0701 100644 --- a/doc/app/Trip.html +++ b/doc/app/Trip.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -128,6 +134,26 @@

    class Trip

    +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Trip con relación uno-a-muchos:

    +
    • +

      belongs_to: Trip referencia un objeto User

      +
    • +

      has_many: un Trip referenciado por muchos Visit

      +
    • +

      has_many: un Trip referenciado por muchos Site

      +
    +
    diff --git a/doc/app/TripsController.html b/doc/app/TripsController.html index abfde19..7a51288 100644 --- a/doc/app/TripsController.html +++ b/doc/app/TripsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -150,6 +156,27 @@

    class TripsController

    +

    Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a viajes, la ruta determina qué +controlador y acción realizar.

    + +

    Métodos para controlador viajes

    +
    • +

      index

      +
    • +

      show

      +
    • +

      new

      +
    • +

      edit

      +
    • +

      create

      +
    • +

      update

      +
    • +

      destroy

      +
    +
    @@ -186,7 +213,7 @@

    Public Instance Methods

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

    Public Instance Methods

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

    Public Instance Methods

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

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 8
    +            
    # File app/controllers/trips_controller.rb, line 18
     def index
       @trips = Trip.all
     
    @@ -327,7 +354,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 31
    +            
    # File app/controllers/trips_controller.rb, line 41
     def new
       @trip = current_user.trips.build
       
    @@ -362,7 +389,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/trips_controller.rb, line 19
    +            
    # File app/controllers/trips_controller.rb, line 29
     def show
       @trip = Trip.find(params[:id])
       @visit = @trip.visits.build
    @@ -398,7 +425,7 @@ 

    Public Instance Methods

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

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -122,6 +128,11 @@

    module TripsHelper

    +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para trips.
    +
    diff --git a/doc/app/Type.html b/doc/app/Type.html index c9f3a24..7ff419b 100644 --- a/doc/app/Type.html +++ b/doc/app/Type.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -128,6 +134,20 @@

    class Type

    +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Type con relación uno-a-muchos:

    +
    • +

      has_many: un Type referenciado por muchos Site

      +
    +
    diff --git a/doc/app/TypesController.html b/doc/app/TypesController.html index e69e052..fbedc5d 100644 --- a/doc/app/TypesController.html +++ b/doc/app/TypesController.html @@ -80,6 +80,8 @@

    Methods

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

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -150,6 +158,27 @@

    class TypesController

    +

    Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a tipos, la ruta determina qué +controlador y acción realizar

    + +

    Métodos para controlador tipos

    +
    • +

      index

      +
    • +

      show

      +
    • +

      new

      +
    • +

      edit

      +
    • +

      create

      +
    • +

      update

      +
    • +

      destroy

      +
    +
    @@ -186,7 +215,7 @@

    Public Instance Methods

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

    Public Instance Methods

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

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 36
    +            
    # File app/controllers/types_controller.rb, line 46
     def edit
       @type = Type.find(params[:id])
     end
    @@ -292,9 +321,9 @@

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 4
    -def index
    -  @types = Type.all
    +            
    # File app/controllers/types_controller.rb, line 14
    +def index  
    +  @types = Type.all  #busca colección de recursos
     
       respond_to do |format|
         format.html # index.html.erb
    @@ -327,7 +356,7 @@ 

    Public Instance Methods

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

    Public Instance Methods

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

    #ordered_index

    + + + +
    +
    # File app/controllers/types_controller.rb, line 95
    +def ordered_index
    +  @types = Type.find(:all, :order => :name)
    +  respond_to do |format|
    +    format.html { render action: "index" }
    +    format.json { render json: @types }
    +  end
    +end
    +
    + +
    + + + + +
    + +
    @@ -362,9 +425,9 @@

    Public Instance Methods

    -
    # File app/controllers/types_controller.rb, line 15
    +            
    # File app/controllers/types_controller.rb, line 25
     def show
    -  @type = Type.find(params[:id])
    +  @type = Type.find(params[:id])  #busca elemento en la tabla
     
       respond_to do |format|
         format.html # show.html.erb
    @@ -397,7 +460,7 @@ 

    Public Instance Methods

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

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -122,6 +128,11 @@

    module TypesHelper

    +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para types.
    +
    diff --git a/doc/app/User.html b/doc/app/User.html index 5fa3862..725bdca 100644 --- a/doc/app/User.html +++ b/doc/app/User.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -128,6 +134,23 @@

    class User

    +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Use con relación uno-a-muchos:

    +
    • +

      has_many: un Use referenciado por muchos Site

      +
    • +

      has_many: un Use referenciado por muchos Trip

      +
    • +

      has_many: un Use referenciado por muchos Comment

      +
    +
    diff --git a/doc/app/Visit.html b/doc/app/Visit.html index ad56b8f..0b8ffa1 100644 --- a/doc/app/Visit.html +++ b/doc/app/Visit.html @@ -87,6 +87,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -128,6 +134,23 @@

    class Visit

    +

    Hereda lógica ORM de ActiveRecord::Base

    + +

    ORB (Object-Relational Mapping):

    +
    • +

      patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

      +
    + +

    Modelo de Visit con relación uno-a-muchos:

    +
    • +

      belongs_to: Visit referencia un objeto Trip

      +
    • +

      belongs_to: Visit referencia un objeto Site

      +
    +
    diff --git a/doc/app/VisitsController.html b/doc/app/VisitsController.html index 00709aa..f0e201c 100644 --- a/doc/app/VisitsController.html +++ b/doc/app/VisitsController.html @@ -109,6 +109,12 @@

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -150,6 +156,27 @@

    class VisitsController

    +

    Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a visitas, la ruta determina qué +controlador y acción realizar

    + +

    Métodos para controlador visitas

    +
    • +

      index

      +
    • +

      show

      +
    • +

      new

      +
    • +

      edit

      +
    • +

      create

      +
    • +

      update

      +
    • +

      destroy

      +
    +
    @@ -186,7 +213,7 @@

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 42
    +            
    # File app/controllers/visits_controller.rb, line 52
     def create
       @visit = Visit.new(params[:visit])
     
    @@ -227,7 +254,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 75
    +            
    # File app/controllers/visits_controller.rb, line 85
     def destroy
       @visit = Visit.find(params[:id])
       @visit.destroy
    @@ -263,7 +290,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 36
    +            
    # File app/controllers/visits_controller.rb, line 46
     def edit
       @visit = Visit.find(params[:id])
     end
    @@ -293,7 +320,7 @@

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 4
    +            
    # File app/controllers/visits_controller.rb, line 14
     def index
       @visits = Visit.all
     
    @@ -328,7 +355,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 26
    +            
    # File app/controllers/visits_controller.rb, line 36
     def new
       @visit = Visit.new
     
    @@ -363,7 +390,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 15
    +            
    # File app/controllers/visits_controller.rb, line 25
     def show
       @visit = Visit.find(params[:id])
     
    @@ -398,7 +425,7 @@ 

    Public Instance Methods

    -
    # File app/controllers/visits_controller.rb, line 59
    +            
    # File app/controllers/visits_controller.rb, line 69
     def update
       @visit = Visit.find(params[:id])
     
    diff --git a/doc/app/VisitsHelper.html b/doc/app/VisitsHelper.html
    index 4ff2034..1e4a461 100644
    --- a/doc/app/VisitsHelper.html
    +++ b/doc/app/VisitsHelper.html
    @@ -81,6 +81,12 @@ 

    Class and Module Index

  • ApplicationHelper +
  • Comment + +
  • CommentsController + +
  • CommentsHelper +
  • PlanetController
  • PlanetHelper @@ -122,6 +128,11 @@

    module VisitsHelper

    +

    Rails genera método helper para facilitar la programación de vistas y +controladores.

    + +
    * En este caso para visits.
    +
    diff --git a/doc/app/created.rid b/doc/app/created.rid index 2aaa3ea..6ddaec3 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 +Thu, 26 Apr 2012 11:14:27 +0200 +doc/README_FOR_APP Tue, 24 Apr 2012 16:25:19 +0200 +app/models/site.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/visit.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/type.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/comment.rb Thu, 26 Apr 2012 11:14:19 +0200 +app/models/trip.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/user.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/helpers/comments_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/types_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/application_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/planet_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/helpers/visits_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/sites_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/helpers/trips_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/controllers/sites_controller.rb Thu, 26 Apr 2012 01:28:15 +0200 +app/controllers/types_controller.rb Thu, 26 Apr 2012 01:25:25 +0200 +app/controllers/application_controller.rb Thu, 26 Apr 2012 01:07:58 +0200 +app/controllers/comments_controller.rb Thu, 26 Apr 2012 01:28:34 +0200 +app/controllers/visits_controller.rb Thu, 26 Apr 2012 01:29:04 +0200 +app/controllers/planet_controller.rb Thu, 26 Apr 2012 02:18:29 +0200 +app/controllers/trips_controller.rb Thu, 26 Apr 2012 01:25:15 +0200 diff --git a/doc/app/doc/README_FOR_APP.html b/doc/app/doc/README_FOR_APP.html index cfe337b..1255c65 100644 --- a/doc/app/doc/README_FOR_APP.html +++ b/doc/app/doc/README_FOR_APP.html @@ -63,6 +63,12 @@

    Class and Module Index

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

    Class and Module Index

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    En esta clase\n

    clase ApplicationController — Definimos instrucción para posibles ataques al servidor.\n\n"],["ApplicationHelper","","ApplicationHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["Comment","","Comment.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["CommentsController","","CommentsController.html","","

    Clase Ruby que hereda de ApplicationController. Cuando la\naplicación reciba una petición referente a …\n"],["CommentsHelper","","CommentsHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["PlanetController","","PlanetController.html","","

    PlanetController ilustra el uso de RDoc. La documentación\nde un proyecto en genera en el directorio …\n"],["PlanetHelper","","PlanetHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["Site","","Site.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["SitesController","","SitesController.html","","

    Clase Ruby que hereda de ApplicationController. Cuando la\naplicación reciba una petición referente a …\n"],["SitesHelper","","SitesHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["Trip","","Trip.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["TripsController","","TripsController.html","","

    Clase Ruby que hereda de ApplicationController. Cuando la\naplicación reciba una petición referente a …\n"],["TripsHelper","","TripsHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["Type","","Type.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["TypesController","","TypesController.html","","

    Clase Ruby que hereda de ApplicationController. Cuando la\naplicación reciba una petición referente a …\n"],["TypesHelper","","TypesHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["User","","User.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["Visit","","Visit.html","","

    Hereda lógica ORM de ActiveRecord::Base\n

    ORB (Object-Relational Mapping):\n

    patrón orientado a objetos de …\n"],["VisitsController","","VisitsController.html","","

    Clase Ruby que hereda de ApplicationController. Cuando la\naplicación reciba una petición referente a …\n"],["VisitsHelper","","VisitsHelper.html","","

    Rails genera método helper para facilitar la programación de vistas y\ncontroladores.\n\n

    * En este caso para ...
    \n"],["author","PlanetController","PlanetController.html#method-i-author","()","

    Acción author\n"],["contact","PlanetController","PlanetController.html#method-i-contact","()","

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    ordered_index\n"],["search","PlanetController","PlanetController.html#method-i-search","()","

    Método que define la búsqueda de palabras a encontrar en la aplicación\n"],["show","CommentsController","CommentsController.html#method-i-show","()","

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

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

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

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

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

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

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

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

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

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

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

    Classes/Modules

    • ApplicationController + + +
    • ApplicationHelper +
    • +
    • + Comment + + + +
    • +
    • + CommentsController + + + +
    • +
    • + CommentsHelper
    • PlanetController @@ -52,39 +76,84 @@

      Classes/Modules

    • Site + + +
    • SitesController + + +
    • SitesHelper
    • Trip + + +
    • TripsController + + +
    • TripsHelper
    • Type + + +
    • TypesController + + +
    • TypesHelper
    • User + + +
    • Visit + + +
    • VisitsController + + +
    • VisitsHelper @@ -95,59 +164,77 @@

      Classes/Modules

      Methods

      diff --git a/public/025/favicon.ico b/public/025/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2536afac13639b72df2391cd609231dc550ceeed GIT binary patch literal 1150 zcmb7^%WoT16vhXMKcFktELebqKw<+s79bX^5iEcO65`QRN>!yGR0OS1g+z<0rb2DW zLkY@*)Nz`mEv;JII*p6tG&S)%c5KHJXZ#pHXU2Bg)vxDHM8S^MTiO?yexv{waU63Y|2ESe_Ip8XiL8b#A|u_vp-m4y@hee7-S&i%mR z@E3T0d6!^d7DJvX^!+OJI-Q3PvG(_A2{NTT|AZGgw{VbOXNH&<`HbP|?-`q)AeIc0 zHS%}SY?8;aCw0MfoCkqUEvkcDV_;h@WPeu!zTpnV^H%cgRhfv0c z-ptYy{dg&b=fN~TULC-5f0EF4mgP{2jA?T(p_8uK;_KiG-zHbdGIn!-8UJ@otsbK8 z)KU6NNiTo;hlv#9?6n;NkvMIsN3LjKS{AKd5C8u$j8+xz`bi?WFv(&7tLIQ^*O^`$ zXX5sG>KzBe>adpFk{Wf$8)b}ogJ!o!Af9$(s#q)GAffoCd;ip4no-eSzCZ8Qq-+a6 zk#hHnzgMffdw(S5@=Gm)k$=Bt>dp}gl`Se(n~N*IGZ&nqYT5jkHVACS<=zg7><)!e z)!onEi%7m5cB*+U+!!QQSa*BZlzT2cxXh$~gmSBm(X@yc461FLNGc=x4NTi%yHsP> zY!KYK#@Xe=M7MPuslOxhvm&!`DL5ywOHXp_c1iE#ML#DsFi016Tzf<8H^LK4`hG?? z^Qif;gl{?y>9S5J8+QF_a=sf{#}^24?Us*lGD)+y&xXD#^*`(0&6fW3`D%U@ni5}W z_$B98yguHV4fE#p4L-c?mp*r-KepRT}bi<*WF% q@cU==4yrsG-F>Nb6VGaf#BPPM^r9j5mY}b%d^^H__W$5{&yN8Fa(K7^ literal 0 HcmV?d00001 diff --git a/public/app/ApplicationController.html b/public/app/ApplicationController.html new file mode 100644 index 0000000..fe8f8cd --- /dev/null +++ b/public/app/ApplicationController.html @@ -0,0 +1,169 @@ + + + + + + +class ApplicationController - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class ApplicationController

      + +
      + +

      En esta clase

      +
      clase ApplicationController +
      +

      Definimos instrucción para posibles ataques al servidor.

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

      module ApplicationHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para application.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/Comment.html b/public/app/Comment.html new file mode 100644 index 0000000..3ea64a6 --- /dev/null +++ b/public/app/Comment.html @@ -0,0 +1,180 @@ + + + + + + +class Comment - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class Comment

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Comment con relación uno-a-muchos:

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

      class CommentsController

      + +
      + +

      Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a comentarios, la ruta determina +qué controlador y acción realizar.

      + +

      Métodos para controlador comentarios

      +
      • +

        index

        +
      • +

        show

        +
      • +

        new

        +
      • +

        edit

        +
      • +

        create

        +
      • +

        update

        +
      • +

        destroy

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

      Public Instance Methods

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

      POST /comments POST /comments.json

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

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

      + + + +
      +
      # File app/controllers/comments_controller.rb, line 88
      +def destroy
      +  @comment = Comment.find(params[:id])
      +  @comment.destroy
      +
      +  respond_to do |format|
      +    format.html { redirect_to sites_url }
      +    format.json { head :no_content }
      +  end
      +end
      +
      + +
      + + + + +
      + + +
      + +
      + edit() + click to toggle source +
      + + +
      + +

      GET /comments/1/edit

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

      GET /comments GET /comments.json

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

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

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

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

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

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

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

      module CommentsHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para comments.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/PlanetController.html b/public/app/PlanetController.html new file mode 100644 index 0000000..10501fd --- /dev/null +++ b/public/app/PlanetController.html @@ -0,0 +1,375 @@ + + + + + + +class PlanetController - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class PlanetController

      + +
      + +

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

      + +
      $proy> rake doc:app
      + +

      Algunos comandos de formateo

      + +

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

      + +

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

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

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

      +
      + +

      Un * o - definen las entradas de una lista itemizada

      + + +

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

      +
      1. +

        + permite generar negrita, igual que con +HTML

        +
      2. +

        _ permite generar cursiva, igual que con HTML

        +
        • +

          permite generar letra de teletipo, igual que con +HTML

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

      Public Instance Methods

      + + +
      + +
      + author() + click to toggle source +
      + + +
      + +

      Acción author

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

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

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

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

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

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

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

      module PlanetHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para planet.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/Site.html b/public/app/Site.html new file mode 100644 index 0000000..04a398e --- /dev/null +++ b/public/app/Site.html @@ -0,0 +1,189 @@ + + + + + + +class Site - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class Site

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Site con relación uno-a-muchos:

      +
      • +

        belongs_to: Site referencia un objeto Type

        +
      • +

        belongs_to: Site referencia un objeto User

        +
      • +

        has_many: un Site referenciado por muchos Visit

        +
      • +

        has_many: un Site referenciado por muchos Trip

        +
      • +

        has_many: un Site referenciado por muchos Comment

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

      class SitesController

      + +
      + +

      Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a sitios, la ruta determina qué +controlador y acción realizar.

      + +

      Métodos para controlador sitios

      +
      • +

        index

        +
      • +

        show

        +
      • +

        new

        +
      • +

        edit

        +
      • +

        create

        +
      • +

        update

        +
      • +

        destroy

        +
      • +

        count_visita

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

      Public Instance Methods

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

      POST /sites POST /sites.json

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

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

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

      GET /sites/1/edit

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

      GET /sites GET /sites.json

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

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

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

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

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

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

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

      module SitesHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para sites.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/Trip.html b/public/app/Trip.html new file mode 100644 index 0000000..71d0701 --- /dev/null +++ b/public/app/Trip.html @@ -0,0 +1,183 @@ + + + + + + +class Trip - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class Trip

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Trip con relación uno-a-muchos:

      +
      • +

        belongs_to: Trip referencia un objeto User

        +
      • +

        has_many: un Trip referenciado por muchos Visit

        +
      • +

        has_many: un Trip referenciado por muchos Site

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

      class TripsController

      + +
      + +

      Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a viajes, la ruta determina qué +controlador y acción realizar.

      + +

      Métodos para controlador viajes

      +
      • +

        index

        +
      • +

        show

        +
      • +

        new

        +
      • +

        edit

        +
      • +

        create

        +
      • +

        update

        +
      • +

        destroy

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

      Public Instance Methods

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

      POST /trips POST /trips.json

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

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

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

      GET /trips/1/edit

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

      GET /trips GET /trips.json

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

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

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

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

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

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

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

      module TripsHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para trips.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/Type.html b/public/app/Type.html new file mode 100644 index 0000000..7ff419b --- /dev/null +++ b/public/app/Type.html @@ -0,0 +1,177 @@ + + + + + + +class Type - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class Type

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Type con relación uno-a-muchos:

      +
      • +

        has_many: un Type referenciado por muchos Site

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

      class TypesController

      + +
      + +

      Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a tipos, la ruta determina qué +controlador y acción realizar

      + +

      Métodos para controlador tipos

      +
      • +

        index

        +
      • +

        show

        +
      • +

        new

        +
      • +

        edit

        +
      • +

        create

        +
      • +

        update

        +
      • +

        destroy

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

      Public Instance Methods

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

      POST /types POST /types.json

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

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

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

      GET /types/1/edit

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

      GET /types GET /types.json

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

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

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

      #ordered_index

      + + + +
      +
      # File app/controllers/types_controller.rb, line 95
      +def ordered_index
      +  @types = Type.find(:all, :order => :name)
      +  respond_to do |format|
      +    format.html { render action: "index" }
      +    format.json { render json: @types }
      +  end
      +end
      +
      + +
      + + + + +
      + + +
      + +
      + show() + click to toggle source +
      + + +
      + +

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

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

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

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

      module TypesHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para types.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/User.html b/public/app/User.html new file mode 100644 index 0000000..725bdca --- /dev/null +++ b/public/app/User.html @@ -0,0 +1,180 @@ + + + + + + +class User - Rails Application Documentation + + + + + + + + + + + + + + + + +
      +

      class User

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Use con relación uno-a-muchos:

      +
      • +

        has_many: un Use referenciado por muchos Site

        +
      • +

        has_many: un Use referenciado por muchos Trip

        +
      • +

        has_many: un Use referenciado por muchos Comment

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

      class Visit

      + +
      + +

      Hereda lógica ORM de ActiveRecord::Base

      + +

      ORB (Object-Relational Mapping):

      +
      • +

        patrón orientado a objetos de acceso a una BBDD donde los objetos son las +filas de la BBDD

        +
      + +

      Modelo de Visit con relación uno-a-muchos:

      +
      • +

        belongs_to: Visit referencia un objeto Trip

        +
      • +

        belongs_to: Visit referencia un objeto Site

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

      class VisitsController

      + +
      + +

      Clase Ruby que hereda de ApplicationController. Cuando la +aplicación reciba una petición referente a visitas, la ruta determina qué +controlador y acción realizar

      + +

      Métodos para controlador visitas

      +
      • +

        index

        +
      • +

        show

        +
      • +

        new

        +
      • +

        edit

        +
      • +

        create

        +
      • +

        update

        +
      • +

        destroy

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

      Public Instance Methods

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

      POST /visits POST /visits.json

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

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

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

      GET /visits/1/edit

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

      GET /visits GET /visits.json

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

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

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

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

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

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

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

      module VisitsHelper

      + +
      + +

      Rails genera método helper para facilitar la programación de vistas y +controladores.

      + +
      * En este caso para visits.
      + +
      + + + + +
      + + + + + + + + + + +
      + +
      + + + + diff --git a/public/app/created.rid b/public/app/created.rid new file mode 100644 index 0000000..6ddaec3 --- /dev/null +++ b/public/app/created.rid @@ -0,0 +1,22 @@ +Thu, 26 Apr 2012 11:14:27 +0200 +doc/README_FOR_APP Tue, 24 Apr 2012 16:25:19 +0200 +app/models/site.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/visit.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/type.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/comment.rb Thu, 26 Apr 2012 11:14:19 +0200 +app/models/trip.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/models/user.rb Thu, 26 Apr 2012 02:00:23 +0200 +app/helpers/comments_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/types_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/application_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/planet_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/helpers/visits_helper.rb Thu, 26 Apr 2012 02:10:52 +0200 +app/helpers/sites_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/helpers/trips_helper.rb Thu, 26 Apr 2012 02:08:18 +0200 +app/controllers/sites_controller.rb Thu, 26 Apr 2012 01:28:15 +0200 +app/controllers/types_controller.rb Thu, 26 Apr 2012 01:25:25 +0200 +app/controllers/application_controller.rb Thu, 26 Apr 2012 01:07:58 +0200 +app/controllers/comments_controller.rb Thu, 26 Apr 2012 01:28:34 +0200 +app/controllers/visits_controller.rb Thu, 26 Apr 2012 01:29:04 +0200 +app/controllers/planet_controller.rb Thu, 26 Apr 2012 02:18:29 +0200 +app/controllers/trips_controller.rb Thu, 26 Apr 2012 01:25:15 +0200 diff --git a/public/app/doc/README_FOR_APP.html b/public/app/doc/README_FOR_APP.html new file mode 100644 index 0000000..1255c65 --- /dev/null +++ b/public/app/doc/README_FOR_APP.html @@ -0,0 +1,123 @@ + + + + + + +README_FOR_APP - Rails Application Documentation + + + + + + + + + + + + + + + + +
      + +

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

      + +
      + + + + + diff --git a/public/app/images/add.png b/public/app/images/add.png new file mode 100755 index 0000000000000000000000000000000000000000..6332fefea4be19eeadf211b0b202b272e8564898 GIT binary patch literal 733 zcmV<30wVp1P)9VHk(~TedF+gQSL8D5xnVSSWAVY>J9b+m>@{iq7_KE}go~11+5s4;8hc+i0Xa zI1j@EX5!S+Me6HNqKzU5YQwL;-W5$p%ZMKMeR<%zp69-~?<4?8|C8S?bklXr4v&Ov zb&06v2|-x?qB`90yn>Qi%Sh2^G4n)$ZdyvTPf9}1)_buUT7>`e2G&2VU@~Bb(o+Mz zi4)>IxlSY${Dj4k={-9RzU^W5g9|2V5RZ2ZulL9s2xQbZ@r6eP9Ra5u(s|C0Nj#&4>wTSkb?%#=9?@ z^oxDy-O@tyN{L@by(WWvQ3%CyEu8x{+#Jb4-h&K9Owi)2pgg+heWDyked|3R$$kL@A z#sp1v-r+=G4B8D6DqsDH0@7OztA7aT9qc1Py{()w`m``?Y0&gi2=ROcc-9+nU^I6< zT=e_Y=vSnG@?3Ue{BW5ONFttcE!R-R_W4O01|0-|K-YNXLo2`4Qv z`r1LxR6#yf3FB%T95gJnaKKivA~Z}S9A(ZxEDK}O3T04USJ P00000NkvXXu0mjf^IS-S literal 0 HcmV?d00001 diff --git a/public/app/images/brick.png b/public/app/images/brick.png new file mode 100644 index 0000000000000000000000000000000000000000..7851cf34c946e5667221e3478668503eb1cd733f GIT binary patch literal 452 zcmV;#0XzPQP)Pdwe5?6tW?r-ok|b$oDQj8FV%kZPq;(MWOV8?8;<)(iP}>hNMU> z7fbz%jjlr7h8uuoQ~J6}n}@Y@PdTk=)PxO{%7zmL?dchpZX*~n;I{!C>*(8cU;q(~ zAS%Po_@naEU!xidrBXD?;hN|x^%W|Ij)0y*r5vi|?W&Fub(NqJ@z0o=O&SR3v>A``^efOSo-hEdApp;^Jd;9y!%1UfzX6Bh- z%-mbG|0Na{7Ruai_Y+DEb1s+b!*9k%Q!whMxjtZKA*?o;i1g&jy0@( zaU=-@d-h+o%gal6JRXEXA&L3`d2 z%jIxzZ~*p9O-;EJp_Ds0If38rM<5W8ic~K>FOK&2_p!CLg^i63OioVb6k$)zWHLx3 z5;!|M!}<9+#QSi1dRlbEcxPt^;cysUuU8@%3}RwpLRIGG<|IKnoyP6$Eh3SKw7a*r zSDXP=IY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eg55P&8UO$Q literal 0 HcmV?d00001 diff --git a/public/app/images/bullet_black.png b/public/app/images/bullet_black.png new file mode 100644 index 0000000000000000000000000000000000000000..57619706d10d9736b1849a83f2c5694fbe09c53b GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$h^>lFz(Kw&{<9vg>5sw~gS5O!4 zr|{HuUFIBKiQyL}eBJ-L{`UVT|6_O~L{G%N{Wbre{kQtZ_0LvEhC#5QQ<|d}62BjvZR2H60wE-$h^mK6y(Kw&{<9vg>(S^W+6Zii9 z|Nhthr~iNb*Z!}6uiN$Dz5neG3a-`baBX8yz1H+_;eX)`ni0%X8XBDc-`=Ph(Uan2 zYsR{H!kvIN--9isvHznRsC#5QQ<|d}62BjvZR2H60wE-$h_H=O!(Kw&{<9vg>(S^W+6Zii9 z|Nhthr~iNb*Z!}6uiN$Dz5neG3a-`baBX8yz4q@v|B?28{s)#N@CGn3@%_y|zAV9T z66e<&B4?b6oF&azg|C(V&1ZbI_D}pL`}(^FT2yXwG1Ph~$Q@h8mJYOz!PC{xWt~$( F699+YQR)By literal 0 HcmV?d00001 diff --git a/public/app/images/date.png b/public/app/images/date.png new file mode 100644 index 0000000000000000000000000000000000000000..783c83357fdf90a1c7c024358e1d768b5c09c135 GIT binary patch literal 626 zcmV-&0*(ENP)5OC%H;f`~O(q$Q#t2<^v$A>fbmv%e#dKTwK=Ku{5lS|}<-`a#7b zzTCOnnT>at)D}AMFuOZ5&%EqFN(lyumd$2ASF6=;nM~%2?gqc@U=#|4PqkX@EBo-9 z7pD#bO_RUa>*faM`8;MYfVi$JnB-zcBFc6gjl$d!bF98Q!!!(Z1_R~P?e!pt#6CHJ9S&n_n&@=9 z%GP;!@Co4c*at+6vNz7o(6en^Q1%qHrc;1)9IRaz-$@S$Z-qdC^ds3X0NvQH;KS)D z-dh&rW&@X;1cS(45z)J&BVt+tv&GMVJ%!EiW) zLBGZW)#Z+gl-Lih&?>X3SS-S#ujQ;9JRXmIB7X)8`d6ETj)D#Q2+$s|<_b7-B9Xvq zwNfqlEp%y3$uY`h{Y$(Gn5@}sqEsq95lpAkFO5dyBmP6^H-51G4J|rN2Ujt<`2YX_ M07*qoM6N<$fC4}Mrzlg<+1Y8PEBfUp0jJpx4B>@E+cy3`^(Gw`Mf+2&yxZm<$to~Vpgvg&QKNR z_f#1(r6svZt%iF?s+n<8X?B&!h3g9Dbb8_=MX}!;HiQSAh`bp^WMl~Z-44teO7W_Y zV4thSL{h;rJY7!l3%5J4H1!tIzB`Dv+YxO(haWeausGZYkI8^hWj6mzo=L0{%;yxzh{5!Htr?51 zvG|W62MzC8BZ76hRpCyO2zOn<%e)K>NHge!-~)Ap33OdWw6hsLYbCxGNt0%wk_2z7 zfyYvXheSG)5HRK1VB~%mq7Dmurw#bi@hEcOr3&G1ZiF*$M=&9nB#VNf&Q^r$4G5kp zTURh&s)E0%5&hyVD}sp<72~zmAY`Y(9aqO6CXF%=zFHGzO-A&I(pE}v70YQxCPJ{Y z4L+?5-crdLn3ZRPEs!A4ehEY3ZRpL~w9>@aMN+{F4dI@v&>(QDHQum!mG~E^$OS8l z!7?%Uwib*ROP67Hw`ika)gX-(8Ia`-u_IEhxG7U<13kSsMW+$lbb2dUMm5p6pa}cjgA+U$^mJ^AjD?&bdi)8~y+Q002ovPDHLkV1g8IMc@Dc literal 0 HcmV?d00001 diff --git a/public/app/images/find.png b/public/app/images/find.png new file mode 100644 index 0000000000000000000000000000000000000000..1547479646722bda4647df52cf3e8bc9b77428c6 GIT binary patch literal 659 zcmV;E0&M+>P)IO9T&v~?D!=C@G6X*U1@h2}>2WE%HrrsjTfQsh6N9%SR25A5rkWp0g zzi;-6|3HJE;58sAyX1e@^d7EwiKQLb00%dp|5+t<{|l;G!D3eSuFDma zRCxr2MVY_`ELgLXqo}ssqp5E;*r|opZT~&|!~VN?1^mw`Yx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00001 diff --git a/public/app/images/macFFBgHack.png b/public/app/images/macFFBgHack.png new file mode 100644 index 0000000000000000000000000000000000000000..c6473b324ee1dae1faaacc0826639833f551116c GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIEX7WqAsj$Z!;#Vf4nJ za0`Jjl>Qs8<JF;+Fd5q0wCR k?u=~bH}2*0f`J3~k>FVdQ&MBb@0BAfpf&c&j literal 0 HcmV?d00001 diff --git a/public/app/images/package.png b/public/app/images/package.png new file mode 100644 index 0000000000000000000000000000000000000000..da3c2a2d74bab159ba0f65d7db601768258afcb2 GIT binary patch literal 853 zcmV-b1FHOqP)5TQ^(M5v$(QKVE?W+9X! z*o}&~6c?_FreF)9NJB7b5Nbn{G0n4+%uJhR9(V5R|NFTpb|HgjefT!tIhLx@DR+N) zV+fHiR5Yt19}k|KnCsND{tH-`IMJ)3AE?OtyZ4>Un|6(d%h#JK`i&a7^xW9>`yBy` zS4SOHeOpC7$?hH5-#7Rswiue_8Ju*2N@$58=a#2OTA3png`w3v->gWif7t%e$ z$NLVS!tFT#8WL|Wa&K~+{%4P2cRfwesYV1_!F=3OaRVHl(>=`%&{x*s30c}#CNE@&;ItrAv!f!)Oy$Q9t$uS=(sD$-J{T*^(8Eez1E-l3}} zPrfHZ1`qsIFe&gipuL8-IZbo2Yg{lFGKs?ZZWcOaOdk*3`5T;$?AjbG1#`B510Er^h2)2r3Y{!8_2Gj=$KzuN5 zaErtW8W_Y2iJJjY)5pmTVJoPJYpanPOEuYHclM^C1F>${hFRpdi8a<2H|Xudf78bm(zwJ9`K%6I?q*Ua~ fW9JvIbn5*B+_J)rUMBs>00000NkvXXu0mjfH&TkY literal 0 HcmV?d00001 diff --git a/public/app/images/page_green.png b/public/app/images/page_green.png new file mode 100644 index 0000000000000000000000000000000000000000..de8e003f9fb8752c09e7f3655d5d8664b5c62fc3 GIT binary patch literal 621 zcmV-z0+RiSP)QqUjAtB;_Vvt6}AS_5YgM`Uqu`yva+H8^=4U$e4gHb}u zAQ2N{V3A%pO|?Pv?tb6z=jC}SiRa$G^v3q?*6XcYz$p|cq{uLj@#~Fi`J(>5{@&&N zy%T^+;>8cXx%|o77anP?&W1?1A(>-T49z9pyeCl@7YI+Si zKti7=B~``}TImz(G{0PnlQA3P#MAd}sorMjkP!50B7$nAkU^%#nl{Q9lW0@}9fE-> zN(q7tRuiC_T1r|BBtVBTlQ2+70$Rf;eF`Z;lx46Cpu-rEgb)EBKq(b^W8l<^We(`D z43?0=01z<3G6+UUv6`CsWCk6^93!#+<;ws7007{zS3k2k9-zZKFO~(k`>s0y006+1 zgF_jyIhsL-`FMf~JL~C=cV75(CrJ|q;MVO961G=O zm9d)YpJg5g(4i_HKL75eSE}mq$Y}r}hyVdcV~p>6a}oXr80q`oj%+s700000NkvXX Hu0mjfPs|!l literal 0 HcmV?d00001 diff --git a/public/app/images/page_white_text.png b/public/app/images/page_white_text.png new file mode 100644 index 0000000000000000000000000000000000000000..813f712f726c935f9adf8d2f2dd0d7683791ef11 GIT binary patch literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%6;pyTSA|c6o&@eC9QG)Hj&ExYL zO&oVL^)+cM^qd@ApywS>pwx0H@RDN}hq;7mU-SKczYQ-hnrr=;iDAQMZQ+*g=YOM= z!QlMQEn7FbaD->uKAYgo_j9)W&$$zS*W9}m(ey0q$&7l-XEWO0Y(9M=SnhLbwy;d>@~SY$Ku*0xPvIOQeV1x7u_z-2-X>_74(yfh7C znXL|3GZ+d2`3re2hs?MKC#5QQ<|d}62BjvZR2H60wE-$R?&;zfqH(@;q9b3Efq-lM(nr^( z=EYR73-9e)UYMWsXy%?aZsD68Yyv^2$~6QgEcljw%kx>O(f-gQ?@fOOx3A-0+Qw?O zRx~W)kn~Qe2d6f9nMG#g9Q04Mk==M~N!Dglvxk!fgVh#w@ZV$IY1+Xc`d{d2UcaP~ zfWp)_Ivqj}l2SPy^9ZWy6rG9Yx4v67_uA&&9|XA~5-#3)W3%em1peD8RWH^#O%XoM zxMPud%}GTj#~*+7JMxTd!`{^Q+>(D3*|@KV`*G2;{QnANOxu1$r2xIe;OXk;vd$@? F2>@zac~<}c literal 0 HcmV?d00001 diff --git a/public/app/images/plugin.png b/public/app/images/plugin.png new file mode 100644 index 0000000000000000000000000000000000000000..6187b15aec001b7080b51a5f944f07591f26cc15 GIT binary patch literal 591 zcmV-V0eEcNHZMNv|IbJ-M`( zKwWL~opzjJe^WpCmV9E;(0&ut2;4va_(#>M8)>9$R5viQnf(Nkh~VM$y>J(jqb$cj z+nL1Nm|mV)Gm|9MnHf*7Ja4OEAQz__^LRKOLEwqpiGV^^A*T=#&inGm-62Xs;dnSp zKj&H9T*boh2i)W+(n27l!C)>fq|L%VB1i ziC4p;NwV_}ZjW7$LRW#(_bKF#hp=!IqNO26Z*w2+LEwx{PVnZ&Sn}T;mtzb$;qA*nT@@+ zV5uQ@iXDTPoTbV#FRr~z04|PPh`wXTNoCm9*tG&?e3+fYl>K6+&3|Cc$KOpL`ER+_ dcRl5U#9zn6ZO}GFk7R5;7c zlif>`Q5?tj7Yw@ZCMtTF^Q|ZedeJhM%QPCR*bs8V79p$QTo7e94yQNXRs-{0?hOn_-8n0AMO@u1Ts zNl8QzJs1#rz%RBt?ux>l+amAvh+J!{$lkaqv}+Erb-6j2xp>K4GLQnNB*W`hFg*?P z^AL@~(h~Z+wfcWEXHqV^Tq-#z$7Y#o0;yFxA!00F}F2dX# zjE$iOgT#G4*1TR6kB1Gnn@>$meCh2a>c5YuIvFn-R2W@>4@M*m@-|jiDV?b)bccgA zyPfsMM!rjy>+1O2)5Eg29Z_*2p&qGnmS!OH?vZ(4>QB01d>j%9n4QINxkyT(Dos?I zjaWF$*IQmh`SF-?xU%xMEfjq1=6qY*g&lgG_cXv$BGoIWyfO5 zp>pdV*O+y=&6@N2WWFo(%RtT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Mh>z2Koi1SL-~N2ZrIf+dZW|;SWszsde}Dl!HOMc1Fa>K9)e&RI z)A?aK zcviCdKDUg_%#u7YAE`A`Y3$(P4&m^@fEWAvjAwVmRWeUnmkrxA;E!fKoc{9Vi=lvFL}KmoS;g* zdjL?Y!VHUFq63aLj6VZE+tHts?Z1pFkiO9^k*5pGpFpU&5#5G4ATd{t>a&9zKBVB9=Ns^HFU|DTGH8C+Xr2UqOU`Zxe)!|%j4=-QojGePq)pRGe;!f)Czk!u3vP_Jxu8(e6 zf4Q`F$Qio2Jw@N*E@k?c`+Sw}AYQjkT+x)OAe6eq(AT!iRuksKQn%Ao_Ac1T-p#Js I_CnHs0qX}mlmGw# literal 0 HcmV?d00001 diff --git a/public/app/images/tag_green.png b/public/app/images/tag_green.png new file mode 100644 index 0000000000000000000000000000000000000000..83ec984bd73364134da0f98d27a800c5d3264180 GIT binary patch literal 613 zcmV-r0-F7aP)^5T)AZ%#@G{_P{NCN^P z(J0zvSn~SSm(Ur);-M~8^*;61*VRI`T1BN&LAhK;sZ>I-SVW;vfUfJv=ko^ugnc0x zhJodBxe>iyk3%w<%wC8holUJ4(iv>tL{`DQt zPOsyUbO_Cmc&*iHkqbm3ku`|GcC^OhF>jj9W*GkH;^g!iUVpib_h*=@udp4h(P+e*zL_~ZmJjh(y^BxULwq>9zXoYE8sq{#pN~U0C6!8vY)5N2 z9P*}mw}7X$O^qTtJef1ACWvJT9^wt-)Zh0r~j#0bT`f;-zv6 z^Tmw22!%rMcs!TaUX<-8s;X-B`+Xbo+_uWuFa z1yIPc?DTrQ7KvRhmt*TG|L=EYQ=LqFX;=Lp`4}jx6BE-@00000NkvXXu0mjf=s_29 literal 0 HcmV?d00001 diff --git a/public/app/images/transparent.png b/public/app/images/transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..d665e179efd797451084235f105425247fea0a14 GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5X>;M1%mmiTn0pv241o;Is pI6S+N2ITN~x;Tb#$R;N!@B(=T42&&nK2`x)44$rjF6*2UngG277DE64 literal 0 HcmV?d00001 diff --git a/public/app/images/wrench.png b/public/app/images/wrench.png new file mode 100644 index 0000000000000000000000000000000000000000..5c8213fef5ab969f03189d4367e32e597e38bd7f GIT binary patch literal 610 zcmV-o0-gPdP)^jb z4`0v}DG1te)wmeb(>p90leRz?_mO+^JKy=v&2<29Od6?F%9%(c8los#f*@G`-%W&* z$)uBj2i@u-@SgX}gtyWPe6d*|w6h%R? zScK2#Yn%$sum0cy>90DmY*i{1XqpClEtktsRTZ)lCUe z<FogV^*tm>8*AlX za4oiR!&85LrobG57qUHUX#{>Vz(RHpB5|@>9O6N$jqB8>%($0wxE5R3)b>Y~xtCo$ zCgEk&A?_#IxHdN)9tqre^o{ho4{?hmPuf@^@I3-wncaRd%|~O3xbrKY=&TiwPYkJroM{;WUQTuMY8vpg}f4o)2%U3C;eEDoiEh?94d(rV57VIF#8VqzW$HrDC|#U`x@QDbgi zVl)t9GGz&YY#D?gc%>hISA+_EBpnXt#pnC`p6@xw0$8TCbULjhlgVx(kuc)%xbgqq zR5+DNDFRN0!y)7Gm}oT0i39}h4h928qY?Rho^UvPGJ#kuW|-Amtrn`Pmd&+bFo@sp z$LI4IQw7BG?|#2ewOS<<3VjL$0=lMY^m;wqZujv5kx1l%Sl;V&Iy4#$ip3&@LV2!7vhhN=PCz%^9v24`qb(+m4W?!q-&~=?ssf5GfnAmJKV;3bvpDm0(NhahZ=&^sqo6Odj6>)Dq_3p~4~ zvb`d3Mydwjt&Df^hVmLtI2x=U&h9(JVYX-!y~z3zi;1>=LY;o(bL$(Yf$lf)dMf0-u^0HrpTG Wk@)HE*94aU0000m+BBgry{~j2fHLegbHP( zrgXNbr0}2;^nywdjLjZe?uxtrd3D(pZH@fFFc0{BW_~jxoO1w7-VX;6vK@ROA$$R6 zEmo;Ht-Mj|>5jUy{bQ^V5@53LRI8AgLpUm|m+15sqcz@QtVSo|oz7ArM8?pIn+>gN z0b=4_b5O|4A*;Q+vc9Vqr~%3V155*NV~@gTz}KSUiKB-uJzjMZ>5%Q#n24H!V{ zTY(LLAE*NAHZ}C#wnj%Bw5OFIkRhkkAW#kDC3j9Wm0YXRaXlyyp>#mVfYG)eC;@ab zDb=T-BCAY4LI(Z@GOTr2V_A{pRwSmz+8Be>CjAw(=gnbVWAeguvZa93JmL(EDxv1m z0OP4q=fpAK1Mq!C2`OkEn37o;m#wF#(t(8Pu#S?2f#x<~4EO{@fmm`p9veD6RZ_jp z@Au4};q&`XuKEYgIiB4((kgxOs#YdqJw0fY>9^K_agEu5+$#k;w#%I2N>n_?)YIqu z`tq&#_^p?-%K*U0^}|7+9U(&k0?s;=r=uCZ%)H9_edH8wK}gB(nUB1FFk+2Ol%BXV zHoFY`D~2x|2 + + + + + +Rails Application Documentation + + + + + + + + + + + + + + + + +

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

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

      Table of Contents - Rails Application Documentation

      + +

      Pages

      + + +

      Classes/Modules

      + + +

      Methods

      + + + + + diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep old mode 100644 new mode 100755 diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml old mode 100644 new mode 100755 diff --git a/test/fixtures/sites.yml b/test/fixtures/sites.yml old mode 100644 new mode 100755 diff --git a/test/fixtures/trips.yml b/test/fixtures/trips.yml old mode 100644 new mode 100755 diff --git a/test/fixtures/types.yml b/test/fixtures/types.yml old mode 100644 new mode 100755 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml old mode 100644 new mode 100755 diff --git a/test/fixtures/visits.yml b/test/fixtures/visits.yml old mode 100644 new mode 100755 diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep old mode 100644 new mode 100755 diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/functional/planet_controller_test.rb b/test/functional/planet_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/functional/planet_controller_test.rb~ b/test/functional/planet_controller_test.rb~ old mode 100644 new mode 100755 diff --git a/test/functional/sites_controller_test.rb b/test/functional/sites_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/functional/trips_controller_test.rb b/test/functional/trips_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/functional/types_controller_test.rb b/test/functional/types_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/functional/visits_controller_test.rb b/test/functional/visits_controller_test.rb old mode 100644 new mode 100755 diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep old mode 100644 new mode 100755 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb old mode 100644 new mode 100755 diff --git a/test/test_helper.rb b/test/test_helper.rb old mode 100644 new mode 100755 diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep old mode 100644 new mode 100755 diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/planet_helper_test.rb b/test/unit/helpers/planet_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/sites_helper_test.rb b/test/unit/helpers/sites_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/trips_helper_test.rb b/test/unit/helpers/trips_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/types_helper_test.rb b/test/unit/helpers/types_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/helpers/visits_helper_test.rb b/test/unit/helpers/visits_helper_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/site_test.rb b/test/unit/site_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/trip_test.rb b/test/unit/trip_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/type_test.rb b/test/unit/type_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb old mode 100644 new mode 100755 diff --git a/test/unit/visit_test.rb b/test/unit/visit_test.rb old mode 100644 new mode 100755 From 611a539d6c7921d272f0df19ad1cdb2c45d0fbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Thu, 26 Apr 2012 16:59:52 +0200 Subject: [PATCH 6/7] Reconoce el usuario que realiza los comentarios --- app/controllers/comments_controller.rb | 8 ++++---- app/controllers/comments_controller.rb~ | 20 +++++++++++++++----- app/views/comments/_form.html.erb | 5 +---- app/views/comments/_form.html.erb~ | 6 +----- app/views/comments/index.html.erb | 2 +- app/views/comments/index.html.erb~ | 4 +++- app/views/comments/show.html.erb | 2 +- app/views/comments/show.html.erb~ | 2 +- app/views/sites/show.html.erb | 2 +- app/views/sites/show.html.erb~ | 4 ++-- doc/app/images/add.png | Bin doc/app/images/delete.png | Bin doc/app/images/tag_blue.png | Bin public/app/images/add.png | Bin public/app/images/delete.png | Bin public/app/images/tag_blue.png | Bin script/rails | 0 test/fixtures/.gitkeep | 0 test/fixtures/comments.yml | 0 test/fixtures/sites.yml | 0 test/fixtures/trips.yml | 0 test/fixtures/types.yml | 0 test/fixtures/users.yml | 0 test/fixtures/visits.yml | 0 test/functional/.gitkeep | 0 test/functional/comments_controller_test.rb | 0 test/functional/planet_controller_test.rb | 0 test/functional/planet_controller_test.rb~ | 0 test/functional/sites_controller_test.rb | 0 test/functional/trips_controller_test.rb | 0 test/functional/types_controller_test.rb | 0 test/functional/visits_controller_test.rb | 0 test/integration/.gitkeep | 0 test/performance/browsing_test.rb | 0 test/test_helper.rb | 0 test/unit/.gitkeep | 0 test/unit/comment_test.rb | 0 test/unit/helpers/comments_helper_test.rb | 0 test/unit/helpers/planet_helper_test.rb | 0 test/unit/helpers/sites_helper_test.rb | 0 test/unit/helpers/trips_helper_test.rb | 0 test/unit/helpers/types_helper_test.rb | 0 test/unit/helpers/visits_helper_test.rb | 0 test/unit/site_test.rb | 0 test/unit/trip_test.rb | 0 test/unit/type_test.rb | 0 test/unit/user_test.rb | 0 test/unit/visit_test.rb | 0 48 files changed, 30 insertions(+), 25 deletions(-) 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 mode change 100755 => 100644 public/app/images/add.png mode change 100755 => 100644 public/app/images/delete.png mode change 100755 => 100644 public/app/images/tag_blue.png mode change 100755 => 100644 script/rails mode change 100755 => 100644 test/fixtures/.gitkeep mode change 100755 => 100644 test/fixtures/comments.yml mode change 100755 => 100644 test/fixtures/sites.yml mode change 100755 => 100644 test/fixtures/trips.yml mode change 100755 => 100644 test/fixtures/types.yml mode change 100755 => 100644 test/fixtures/users.yml mode change 100755 => 100644 test/fixtures/visits.yml mode change 100755 => 100644 test/functional/.gitkeep mode change 100755 => 100644 test/functional/comments_controller_test.rb mode change 100755 => 100644 test/functional/planet_controller_test.rb mode change 100755 => 100644 test/functional/planet_controller_test.rb~ mode change 100755 => 100644 test/functional/sites_controller_test.rb mode change 100755 => 100644 test/functional/trips_controller_test.rb mode change 100755 => 100644 test/functional/types_controller_test.rb mode change 100755 => 100644 test/functional/visits_controller_test.rb mode change 100755 => 100644 test/integration/.gitkeep mode change 100755 => 100644 test/performance/browsing_test.rb mode change 100755 => 100644 test/test_helper.rb mode change 100755 => 100644 test/unit/.gitkeep mode change 100755 => 100644 test/unit/comment_test.rb mode change 100755 => 100644 test/unit/helpers/comments_helper_test.rb mode change 100755 => 100644 test/unit/helpers/planet_helper_test.rb mode change 100755 => 100644 test/unit/helpers/sites_helper_test.rb mode change 100755 => 100644 test/unit/helpers/trips_helper_test.rb mode change 100755 => 100644 test/unit/helpers/types_helper_test.rb mode change 100755 => 100644 test/unit/helpers/visits_helper_test.rb mode change 100755 => 100644 test/unit/site_test.rb mode change 100755 => 100644 test/unit/trip_test.rb mode change 100755 => 100644 test/unit/type_test.rb mode change 100755 => 100644 test/unit/user_test.rb mode change 100755 => 100644 test/unit/visit_test.rb diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 52c24e3..58105f4 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -38,7 +38,7 @@ def show # GET /comments/new # GET /comments/new.json def new - @comment = Comment.new + @comment = current_user.comments.build # crea comentario vacío asociado a current_user respond_to do |format| format.html # new.html.erb @@ -48,13 +48,13 @@ def new # GET /comments/1/edit def edit - @comment = Comment.find(params[:id]) + @comment = current_user.comments.find(params[:id]) end # POST /comments # POST /comments.json def create - @comment = Comment.new(params[:comment], params[:user_id]=>1) + @comment = current_user.comments.build(params[:comment]) respond_to do |format| if @comment.save @@ -70,7 +70,7 @@ def create # PUT /comments/1 # PUT /comments/1.json def update - @comment = Comment.find(params[:id]) + @comment = current_user.comments.find(params[:id]) respond_to do |format| if @comment.update_attributes(params[:comment]) diff --git a/app/controllers/comments_controller.rb~ b/app/controllers/comments_controller.rb~ index 76a6951..58105f4 100644 --- a/app/controllers/comments_controller.rb~ +++ b/app/controllers/comments_controller.rb~ @@ -1,3 +1,13 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a comentarios, la ruta determina qué controlador y acción realizar. +# == Métodos para controlador comentarios +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy class CommentsController < ApplicationController # GET /comments # GET /comments.json @@ -28,7 +38,7 @@ class CommentsController < ApplicationController # GET /comments/new # GET /comments/new.json def new - @comment = Comment.new + @comment = current_user.comments.build # crea comentario vacío asociado a current_user respond_to do |format| format.html # new.html.erb @@ -38,13 +48,13 @@ class CommentsController < ApplicationController # GET /comments/1/edit def edit - @comment = Comment.find(params[:id]) + @comment = current_user.comments.find(params[:id]) end # POST /comments # POST /comments.json def create - @comment = Comment.new(params[:comment], params[:user_id]=>1) + @comment = current_user.comments.build(params[:comment]) respond_to do |format| if @comment.save @@ -60,7 +70,7 @@ class CommentsController < ApplicationController # PUT /comments/1 # PUT /comments/1.json def update - @comment = Comment.find(params[:id]) + @comment = current_user.comments.find(params[:id]) respond_to do |format| if @comment.update_attributes(params[:comment]) @@ -80,7 +90,7 @@ class CommentsController < ApplicationController @comment.destroy respond_to do |format| - format.html { redirect_to planet_url } + format.html { redirect_to sites_url } format.json { head :no_content } end end diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 6066e87..cf483f7 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -15,14 +15,11 @@ <%= f.label :comment %>
      <%= f.text_area :comment %>
  • +
    <%= f.label :site_id %>
    <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %>
    -
    - <%= f.label :user_id %>
    - <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %> -
    <%= f.submit %> diff --git a/app/views/comments/_form.html.erb~ b/app/views/comments/_form.html.erb~ index 6f02051..43b05f8 100644 --- a/app/views/comments/_form.html.erb~ +++ b/app/views/comments/_form.html.erb~ @@ -17,11 +17,7 @@
    <%= f.label :site_id %>
    -<%= select_tag(:site_id, '...') %> -
    -
    - <%= f.label :user_id %>
    - <%= f.collection_select(:user_id, User.find(:all, :order => :name), :id, :name) %> + <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %>
    diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index 8aa87a5..47974f9 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -13,7 +13,7 @@ <% @comments.each do |comment| %> <%= comment.comment %> - <%= comment.user.name %> + <%= comment.user.name if comment.user%> <%= link_to 'Show', comment %> <% if comment.user == current_user %> diff --git a/app/views/comments/index.html.erb~ b/app/views/comments/index.html.erb~ index 4532517..291cfff 100644 --- a/app/views/comments/index.html.erb~ +++ b/app/views/comments/index.html.erb~ @@ -13,15 +13,17 @@ <% @comments.each do |comment| %> <%= comment.comment %> - <%= comment.user.name %> + <%= comment.user.name if @comment.user%> <%= link_to 'Show', comment %> <% if comment.user == current_user %> + <%= link_to 'Edit', edit_comment_path(comment) %> <%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %> <% end %> <% end %> +<%= link_to 'Nuevo comentario', new_comment_path %>
    diff --git a/app/views/comments/show.html.erb b/app/views/comments/show.html.erb index 2d79d5c..2698896 100644 --- a/app/views/comments/show.html.erb +++ b/app/views/comments/show.html.erb @@ -7,7 +7,7 @@

    User: - <%= @comment.user.name %> + <%= @comment.user.name if @comment.user %>

    diff --git a/app/views/comments/show.html.erb~ b/app/views/comments/show.html.erb~ index b3604a0..2d79d5c 100644 --- a/app/views/comments/show.html.erb~ +++ b/app/views/comments/show.html.erb~ @@ -15,6 +15,6 @@ <%= @comment.site.name %>

    -<% if comment.user == current_user %> +<% if @comment.user == current_user %> <%= link_to 'Edit', edit_comment_path(@comment) %> <% end %> diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 299a65a..5d851d0 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -12,7 +12,7 @@ <% @site.comments.each do |comment| %> - + <% if comment.user == current_user %> diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ index 26a741b..3170c96 100644 --- a/app/views/sites/show.html.erb~ +++ b/app/views/sites/show.html.erb~ @@ -12,7 +12,7 @@
    <%= comment.user.name %>: <%= comment.comment %><%= comment.user.name if comment.user %>: <%= comment.comment %> <%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %>
    <% @site.comments.each do |comment| %> - + <% if comment.user == current_user %> @@ -24,7 +24,7 @@ <% end %> <%= render 'geomapa' %> - +

    Numero de viajes en los que aparece: <%= @site.trips.size %>

    Añada su comentario:

    <%= link_to 'Click aqui', new_comment_path %>

    Autor: 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/public/app/images/add.png b/public/app/images/add.png old mode 100755 new mode 100644 diff --git a/public/app/images/delete.png b/public/app/images/delete.png old mode 100755 new mode 100644 diff --git a/public/app/images/tag_blue.png b/public/app/images/tag_blue.png old mode 100755 new mode 100644 diff --git a/script/rails b/script/rails old mode 100755 new mode 100644 diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep old mode 100755 new mode 100644 diff --git a/test/fixtures/comments.yml b/test/fixtures/comments.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/sites.yml b/test/fixtures/sites.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/trips.yml b/test/fixtures/trips.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/types.yml b/test/fixtures/types.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/visits.yml b/test/fixtures/visits.yml old mode 100755 new mode 100644 diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep old mode 100755 new mode 100644 diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/functional/planet_controller_test.rb b/test/functional/planet_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/functional/planet_controller_test.rb~ b/test/functional/planet_controller_test.rb~ old mode 100755 new mode 100644 diff --git a/test/functional/sites_controller_test.rb b/test/functional/sites_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/functional/trips_controller_test.rb b/test/functional/trips_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/functional/types_controller_test.rb b/test/functional/types_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/functional/visits_controller_test.rb b/test/functional/visits_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep old mode 100755 new mode 100644 diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb old mode 100755 new mode 100644 diff --git a/test/test_helper.rb b/test/test_helper.rb old mode 100755 new mode 100644 diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep old mode 100755 new mode 100644 diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/planet_helper_test.rb b/test/unit/helpers/planet_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/sites_helper_test.rb b/test/unit/helpers/sites_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/trips_helper_test.rb b/test/unit/helpers/trips_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/types_helper_test.rb b/test/unit/helpers/types_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/helpers/visits_helper_test.rb b/test/unit/helpers/visits_helper_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/site_test.rb b/test/unit/site_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/trip_test.rb b/test/unit/trip_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/type_test.rb b/test/unit/type_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb old mode 100755 new mode 100644 diff --git a/test/unit/visit_test.rb b/test/unit/visit_test.rb old mode 100755 new mode 100644 From 080e8993dcc2f45a4830e08b4455e71efe558563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Valdenebro=20Gonz=C3=A1lez?= Date: Thu, 26 Apr 2012 18:05:09 +0200 Subject: [PATCH 7/7] Reconoce el sitio donde se realiza el comentario --- app/controllers/comments_controller.rb | 4 ++-- app/controllers/comments_controller.rb~ | 2 +- app/controllers/sites_controller.rb | 1 + app/controllers/sites_controller.rb~ | 20 ++++++++++++++++---- app/models/comment.rb | 2 ++ app/models/comment.rb~ | 10 ++++++++++ app/views/comments/_form.html.erb | 7 ++----- app/views/comments/_form.html.erb~ | 1 + app/views/comments/index.html.erb | 7 +++---- app/views/comments/index.html.erb~ | 7 +++---- app/views/sites/show.html.erb | 2 +- app/views/sites/show.html.erb~ | 6 +++--- 12 files changed, 45 insertions(+), 24 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 58105f4..6cde408 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -39,7 +39,6 @@ def show # GET /comments/new.json def new @comment = current_user.comments.build # crea comentario vacío asociado a current_user - respond_to do |format| format.html # new.html.erb format.json { render json: @comment } @@ -49,6 +48,7 @@ def new # GET /comments/1/edit def edit @comment = current_user.comments.find(params[:id]) + @site = @comment.site end # POST /comments @@ -90,7 +90,7 @@ def destroy @comment.destroy respond_to do |format| - format.html { redirect_to sites_url } + format.html { redirect_to comments_url } format.json { head :no_content } end end diff --git a/app/controllers/comments_controller.rb~ b/app/controllers/comments_controller.rb~ index 58105f4..2d0f2f0 100644 --- a/app/controllers/comments_controller.rb~ +++ b/app/controllers/comments_controller.rb~ @@ -39,7 +39,6 @@ class CommentsController < ApplicationController # GET /comments/new.json def new @comment = current_user.comments.build # crea comentario vacío asociado a current_user - respond_to do |format| format.html # new.html.erb format.json { render json: @comment } @@ -49,6 +48,7 @@ class CommentsController < ApplicationController # GET /comments/1/edit def edit @comment = current_user.comments.find(params[:id]) + @site = @comment.site end # POST /comments diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 546a2d7..509af0b 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -33,6 +33,7 @@ def index # GET /sites/1.json def show @site = Site.find(params[:id]) + @comment = @site.comments.build respond_to do |format| format.html # show.html.erb diff --git a/app/controllers/sites_controller.rb~ b/app/controllers/sites_controller.rb~ index 461cb15..509af0b 100644 --- a/app/controllers/sites_controller.rb~ +++ b/app/controllers/sites_controller.rb~ @@ -1,3 +1,14 @@ +# Clase Ruby que hereda de +ApplicationController+. +# Cuando la aplicación reciba una petición referente a sitios, la ruta determina qué controlador y acción realizar. +# == Métodos para controlador sitios +# * index +# * show +# * new +# * edit +# * create +# * update +# * destroy +# * count_visita class SitesController < ApplicationController # authenticate_user! ejecuta acción solo si sesión existe @@ -22,7 +33,7 @@ class SitesController < ApplicationController # GET /sites/1.json def show @site = Site.find(params[:id]) - @comments = Site.find(params[:id]).comments + @comment = @site.comments.build respond_to do |format| format.html # show.html.erb @@ -89,9 +100,10 @@ class SitesController < ApplicationController format.json { head :no_content } end end - - private - def count_visita + +private +# método cuenta visitas para gestionar el incremento de visitas a sitios +def count_visita @site.increment!(:visitas) end end diff --git a/app/models/comment.rb b/app/models/comment.rb index 06aad18..bb651ba 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -9,4 +9,6 @@ class Comment < ActiveRecord::Base belongs_to :site belongs_to :user + + validates :comment, :user_id, :site_id, :presence => true # campo obligatorio end diff --git a/app/models/comment.rb~ b/app/models/comment.rb~ index 45b2d38..06aad18 100644 --- a/app/models/comment.rb~ +++ b/app/models/comment.rb~ @@ -1,2 +1,12 @@ +# Hereda lógica ORM de ActiveRecord::Base +# +# ORB (Object-Relational Mapping): +# - patrón orientado a objetos de acceso a una BBDD donde los objetos son las filas de la BBDD +# +# == Modelo de Comment con relación uno-a-muchos: +# * belongs_to: Comment referencia un objeto Site +# * belongs_to: Comment referencia un objeto User class Comment < ActiveRecord::Base + belongs_to :site + belongs_to :user end diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index cf483f7..f962c3f 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -16,11 +16,8 @@ <%= f.text_area :comment %> -

    - <%= f.label :site_id %>
    - <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %> -
    - +<%= f.number_field :site_id, :value => @site.id, :hidden => true %> +
    <%= f.submit %>
    diff --git a/app/views/comments/_form.html.erb~ b/app/views/comments/_form.html.erb~ index 43b05f8..cf483f7 100644 --- a/app/views/comments/_form.html.erb~ +++ b/app/views/comments/_form.html.erb~ @@ -15,6 +15,7 @@ <%= f.label :comment %>
    <%= f.text_area :comment %> +
    <%= f.label :site_id %>
    <%= f.collection_select(:site_id, Site.find(:all, :order => :name), :id, :name) %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index 47974f9..774cbaf 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -1,4 +1,4 @@ -

    Listing comments

    +

    Listing comments:

    <%= comment.user.name %>: <%= comment.comment %><%= comment.user.name if @comment.user %>: <%= comment.comment %> <%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %>
    @@ -14,7 +14,7 @@ - + <% if comment.user == current_user %> @@ -23,7 +23,6 @@ <% end %>
    <%= comment.comment %> <%= comment.user.name if comment.user%><%= comment.site.name %> <%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %>
    -<%= link_to 'Nuevo comentario', new_comment_path %> -
    + diff --git a/app/views/comments/index.html.erb~ b/app/views/comments/index.html.erb~ index 291cfff..822b03a 100644 --- a/app/views/comments/index.html.erb~ +++ b/app/views/comments/index.html.erb~ @@ -1,4 +1,4 @@ -

    Listing comments

    +

    Listing comments del sitio:

    @@ -13,7 +13,7 @@ <% @comments.each do |comment| %> - + <% if comment.user == current_user %> @@ -23,7 +23,6 @@ <% end %>
    <%= comment.comment %><%= comment.user.name if @comment.user%><%= comment.user.name if comment.user%> <%= link_to 'Show', comment %>
    -<%= link_to 'Nuevo comentario', new_comment_path %> -
    + diff --git a/app/views/sites/show.html.erb b/app/views/sites/show.html.erb index 5d851d0..f4075aa 100644 --- a/app/views/sites/show.html.erb +++ b/app/views/sites/show.html.erb @@ -26,7 +26,7 @@ <%= render 'geomapa' %>

    Numero de viajes en los que aparece: <%= @site.trips.size %>

    Añada su comentario:

    - <%= link_to 'Click aqui', new_comment_path %> + <%= render 'comments/form' %>

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

    diff --git a/app/views/sites/show.html.erb~ b/app/views/sites/show.html.erb~ index 3170c96..ba6e3dc 100644 --- a/app/views/sites/show.html.erb~ +++ b/app/views/sites/show.html.erb~ @@ -12,10 +12,10 @@ <% @site.comments.each do |comment| %> - + <% if comment.user == current_user %> - + <% end %> @@ -26,7 +26,7 @@ <%= render 'geomapa' %>

    Numero de viajes en los que aparece: <%= @site.trips.size %>

    Añada su comentario:

    - <%= link_to 'Click aqui', new_comment_path %> + <%= render 'comments/form' %>

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

    <%= comment.user.name if @comment.user %>: <%= comment.comment %><%= comment.user.name if comment.user %>: <%= comment.comment %> <%= link_to 'Show', comment %><%= link_to 'Edit', edit_comment_path(comment) %><%= link_to 'Edit', edit_comment_path() %> <%= link_to 'Destroy', comment, confirm: 'Are you sure?', method: :delete %>