<%= notice %>
<%= alert %>
+<%= notice %>
<%= alert %>
<%= yield %>diff --git a/Gemfile b/Gemfile index ec2ba7b..6d43f0d 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,7 @@ group :development, :test do gem 'sqlite3' end + group :production do gem 'pg' end diff --git a/Gemfile.lock b/Gemfile.lock index fd905dc..53fc807 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,7 +60,7 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.18) - multi_json (1.3.1) + multi_json (1.3.2) orm_adapter (0.0.7) paperclip (3.0.2) activemodel (>= 3.0.0) @@ -95,7 +95,7 @@ GEM rake (0.9.2.2) rdoc (3.12) json (~> 1.4) - sass (3.1.15) + sass (3.1.16) sass-rails (3.2.5) railties (~> 3.2.0) sass (>= 3.1.10) @@ -104,7 +104,7 @@ GEM hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.5) + sqlite3 (1.3.6) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) diff --git a/Gemfile.lock~ b/Gemfile.lock~ new file mode 100644 index 0000000..fd905dc --- /dev/null +++ b/Gemfile.lock~ @@ -0,0 +1,134 @@ +GEM + remote: https://rubygems.org/ + specs: + actionmailer (3.2.2) + actionpack (= 3.2.2) + mail (~> 2.4.0) + actionpack (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.1) + rack (~> 1.4.0) + rack-cache (~> 1.1) + rack-test (~> 0.6.1) + sprockets (~> 2.1.2) + activemodel (3.2.2) + activesupport (= 3.2.2) + builder (~> 3.0.0) + activerecord (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.2) + activemodel (= 3.2.2) + activesupport (= 3.2.2) + activesupport (3.2.2) + i18n (~> 0.6) + multi_json (~> 1.0) + arel (3.0.2) + bcrypt-ruby (3.0.1) + builder (3.0.0) + cleditor_rails (0.0.3) + cocaine (0.2.1) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.3.1) + devise (2.0.4) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.0.3) + railties (~> 3.1) + warden (~> 1.1.1) + erubis (2.7.0) + execjs (1.3.0) + multi_json (~> 1.0) + hike (1.2.1) + i18n (0.6.0) + journey (1.0.3) + jquery-rails (2.0.2) + railties (>= 3.2.0, < 5.0) + thor (~> 0.14) + json (1.6.5) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.18) + multi_json (1.3.1) + orm_adapter (0.0.7) + paperclip (3.0.2) + activemodel (>= 3.0.0) + activerecord (>= 3.0.0) + 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) + rack (>= 0.4) + rack-ssl (1.3.2) + rack + rack-test (0.6.1) + rack (>= 1.0) + rails (3.2.2) + actionmailer (= 3.2.2) + actionpack (= 3.2.2) + activerecord (= 3.2.2) + activeresource (= 3.2.2) + activesupport (= 3.2.2) + bundler (~> 1.0) + railties (= 3.2.2) + railties (3.2.2) + actionpack (= 3.2.2) + activesupport (= 3.2.2) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + sass (3.1.15) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.1.2) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.5) + thor (0.14.6) + tilt (1.3.3) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.33) + uglifier (1.2.4) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) + warden (1.1.1) + rack (>= 1.0) + +PLATFORMS + ruby + +DEPENDENCIES + cleditor_rails + coffee-rails (~> 3.2.1) + devise + jquery-rails + json (= 1.6.5) + paperclip + pg + rails (= 3.2.2) + sass-rails (~> 3.2.3) + sqlite3 + uglifier (>= 1.0.3) diff --git a/Gemfile~ b/Gemfile~ new file mode 100644 index 0000000..5db293b --- /dev/null +++ b/Gemfile~ @@ -0,0 +1,49 @@ +source 'https://rubygems.org' + +gem 'rails', '3.2.2' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +group :development do + gem 'sqlite3' +end + + +group :production do + gem 'pg' +end + + +gem 'devise' + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + # gem 'therubyracer' + + gem 'uglifier', '>= 1.0.3' +end + +gem 'jquery-rails' +gem 'cleditor_rails' +gem 'paperclip' + +# To use ActiveModel has_secure_password +# gem 'bcrypt-ruby', '~> 3.0.0' + +# To use Jbuilder templates for JSON +# gem 'jbuilder' + +# Use unicorn as the app server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# To use debugger +# gem 'ruby-debug19', :require => 'ruby-debug' diff --git a/app/assets/images/.thumbnails/arbol1.png.png b/app/assets/images/.thumbnails/arbol1.png.png new file mode 100644 index 0000000..6606091 Binary files /dev/null and b/app/assets/images/.thumbnails/arbol1.png.png differ diff --git a/app/assets/images/.thumbnails/foto_adri.png.png b/app/assets/images/.thumbnails/foto_adri.png.png new file mode 100644 index 0000000..f5b7ae2 Binary files /dev/null and b/app/assets/images/.thumbnails/foto_adri.png.png differ diff --git a/app/assets/images/.thumbnails/foto_hector.jpg.png b/app/assets/images/.thumbnails/foto_hector.jpg.png new file mode 100644 index 0000000..d89fb27 Binary files /dev/null and b/app/assets/images/.thumbnails/foto_hector.jpg.png differ diff --git a/app/assets/images/curriculum_adri-0.png b/app/assets/images/curriculum_adri-0.png new file mode 100644 index 0000000..a5e1d73 Binary files /dev/null and b/app/assets/images/curriculum_adri-0.png differ diff --git a/app/assets/images/curriculum_adri-1.png b/app/assets/images/curriculum_adri-1.png new file mode 100644 index 0000000..c41aaff Binary files /dev/null and b/app/assets/images/curriculum_adri-1.png differ diff --git a/app/assets/images/cv_adri-0.png b/app/assets/images/cv_adri-0.png new file mode 100644 index 0000000..4ade092 Binary files /dev/null and b/app/assets/images/cv_adri-0.png differ diff --git a/app/assets/images/cv_adri-1.png b/app/assets/images/cv_adri-1.png new file mode 100644 index 0000000..5714a4b Binary files /dev/null and b/app/assets/images/cv_adri-1.png differ diff --git a/app/assets/images/foto_adri.png b/app/assets/images/foto_adri.png new file mode 100644 index 0000000..7699a38 Binary files /dev/null and b/app/assets/images/foto_adri.png differ diff --git a/app/assets/images/foto_hector.jpg b/app/assets/images/foto_hector.jpg new file mode 100644 index 0000000..54d8a8e Binary files /dev/null and b/app/assets/images/foto_hector.jpg differ diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/comments.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/comments.css.scss b/app/assets/stylesheets/comments.css.scss new file mode 100644 index 0000000..e730912 --- /dev/null +++ b/app/assets/stylesheets/comments.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Comments controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/planet.css b/app/assets/stylesheets/planet.css index ead053a..7f79a7b 100644 --- a/app/assets/stylesheets/planet.css +++ b/app/assets/stylesheets/planet.css @@ -167,3 +167,7 @@ text-indent: 70%; } + + + + diff --git a/app/assets/stylesheets/planet.css~ b/app/assets/stylesheets/planet.css~ new file mode 100644 index 0000000..ef0aca0 --- /dev/null +++ b/app/assets/stylesheets/planet.css~ @@ -0,0 +1,178 @@ +/* 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%; +} + + + + #map_canvas { + height: 300px; + width: 300px; + } + + + diff --git a/app/assets/stylesheets/sites.css.scss b/app/assets/stylesheets/sites.css.scss index 682e55c..66d323b 100644 --- a/app/assets/stylesheets/sites.css.scss +++ b/app/assets/stylesheets/sites.css.scss @@ -1,3 +1,8 @@ // Place all the styles related to the sites controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ +#site_map { + width: 600px; + height: 300px; + border: 1px solid black; +} \ No newline at end of file diff --git a/app/assets/stylesheets/trips.css.scss b/app/assets/stylesheets/trips.css.scss index 473cbc3..906ace6 100644 --- a/app/assets/stylesheets/trips.css.scss +++ b/app/assets/stylesheets/trips.css.scss @@ -1,3 +1,9 @@ // Place all the styles related to the trips controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +#trip_map { + width: 800px; + height: 450px; + border: 1px solid green; +} diff --git a/app/assets/stylesheets/trips.css.scss~ b/app/assets/stylesheets/trips.css.scss~ new file mode 100644 index 0000000..58aafae --- /dev/null +++ b/app/assets/stylesheets/trips.css.scss~ @@ -0,0 +1,9 @@ +// Place all the styles related to the trips controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + +#trip_map { + width: 600px; + height: 500px; + border: 1px solid black; +} diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 0000000..f29954d --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,57 @@ +class CommentsController < ApplicationController + + # authenticate_user! ejecuta acción solo si sesión existe + before_filter :authenticate_user! + + + def create + @site = Site.find(params[:site_id]) + @comment = @site.comments.create(params[:comment]) + @comment.user_id = current_user.id + @comment.site_id = @site.id + + respond_to do |format| + if @comment.save + format.html { redirect_to @site, notice: 'Comment was successfully created.' } + format.json { head :no_content } + else + format.html { render action: "edit" } + format.json { render json: @comment.errors, status: :unprocessable_entity } + end + end + + end + + def edit + @site = Site.find(params[:site_id]) + @comment = @site.comments.find(params[:id]) + end + + def update + @site = Site.find(params[:site_id]) + @comment = @site.comments.find(params[:id]) + + respond_to do |format| + if @comment.update_attributes(params[:comment]) + format.html { redirect_to @site, notice: '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 + + + def destroy + @site = Site.find(params[:site_id]) + @comment = @site.comments.find(params[:id]) + @comment.destroy + respond_to do |format| + format.html { redirect_to site_path(@site) } + format.json { head :no_content } + end + end + +end diff --git a/app/controllers/planet_controller.rb b/app/controllers/planet_controller.rb index a8636bd..59fe2e3 100644 --- a/app/controllers/planet_controller.rb +++ b/app/controllers/planet_controller.rb @@ -1,9 +1,4 @@ -# 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 -# +# PlanetController # Tal y como muestra el subitulo anterior, este se define empezando la # línea con ==. En los títulos debe empezar por =. # @@ -28,6 +23,20 @@ def contact end # Método que define una acción vacía del controlador def ejemplo + end + # Método que define una acción vacía del controlador + def author + end + # Método que define una acción de búsqueda del controlador + def search + @search=params[:search] + if @search.length>= 3 + @sites = Site.where("name like ? OR description like ?", "%"+@search+"%", "%"+@search+"%") + @trips = Trip.where("name like ? OR description like ?", "%"+@search+"%", "%"+@search+"%") + else + render action: "wrongsearch" + end end - + + end diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 57e0611..190f12c 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -2,7 +2,7 @@ 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 @@ -22,12 +22,12 @@ def index # GET /sites/1.json def show @site = Site.find(params[:id]) - + @site.increment!(:visitas) respond_to do |format| format.html # show.html.erb format.json { render json: @site } end - end + end # GET /sites/new # GET /sites/new.json @@ -49,7 +49,7 @@ def edit # POST /sites.json def create @site = current_user.sites.build(params[:site]) # Asigna solo si sitio asociado a current_user - + respond_to do |format| if @site.save format.html { redirect_to @site, notice: 'Site was successfully created.' } @@ -89,8 +89,4 @@ def destroy end end - private - def count_visita - @site.increment!(:visitas) - end end diff --git a/app/controllers/types_controller.rb b/app/controllers/types_controller.rb index da826f4..146fd9a 100644 --- a/app/controllers/types_controller.rb +++ b/app/controllers/types_controller.rb @@ -9,6 +9,16 @@ def index format.json { render json: @types } end end + # GET /types/ordered_index + # GET /types/ordered_index.json + def ordered_index + @types = Type.find(:all, :order => :name) + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @types } + end + end # GET /types/1 # GET /types/1.json diff --git a/app/controllers/visits_controller.rb b/app/controllers/visits_controller.rb index 5bd5366..4e605d4 100644 --- a/app/controllers/visits_controller.rb +++ b/app/controllers/visits_controller.rb @@ -41,7 +41,8 @@ def edit # POST /visits.json def create @visit = Visit.new(params[:visit]) - + @visit.site.increment!(:times_added) + respond_to do |format| if @visit.save format.html { redirect_to @visit.trip, notice: 'Visit was successfully created.' } @@ -74,6 +75,7 @@ def update # DELETE /visits/1.json def destroy @visit = Visit.find(params[:id]) + @visit.site.decrement!(:times_added) @visit.destroy respond_to do |format| 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..f4e8c50 --- /dev/null +++ b/app/models/comment.rb @@ -0,0 +1,15 @@ +# =Código del modelo de Comentarios +# +# ==Los comentarios tienen los siguientes campos: +# 1.* comment: texto +# 2.* user_id: identificador de usuario +# 3.* site_id: identificador de sitio +# +class Comment < ActiveRecord::Base + belongs_to :user + belongs_to :site + + validates :comment, :presence => true,:length => {:maximum => 240} + # Debe estar protegido para evitar accesos indeseados + attr_protected :user_id +end diff --git a/app/models/site.rb b/app/models/site.rb index 2b2f99a..127ec4e 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -1,7 +1,20 @@ +# =Código del modelo de Site +# +# ==Los sites tienen los siguientes campos: +# 1.* name: nombre +# 2.* description: texto para describir el sitio +# 3.* type: tipo de sitio (monumento, ruina, etc) +# 4.* image: imagen asociada al sitio +# 5.* latitud_geo: para situar en google maps +# 6.* longitud_geo: para situar en google maps +# 7.* zoom_geo: para situar en google maps +# class Site < ActiveRecord::Base + belongs_to :type belongs_to :user has_many :visits + has_many :comments, :dependent => :destroy has_many :trips, :through => :visits has_attached_file :image @@ -10,5 +23,5 @@ class Site < ActiveRecord::Base attr_protected :user_id # Se añaden estas definiciones - validates :name, :type_id, :presence => true # campo obligatorio + validates :name, :type_id,:latitud_geo, :longitud_geo, :zoom_geo, :presence => true # campo obligatorio end diff --git a/app/models/site.rb~ b/app/models/site.rb~ new file mode 100644 index 0000000..d20b767 --- /dev/null +++ b/app/models/site.rb~ @@ -0,0 +1,16 @@ +class Site < ActiveRecord::Base + + belongs_to :type + belongs_to :user + has_many :visits + has_many :comments, :dependent => :destroy + 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,:latitud_geo, :longitud_geo, :zoom_geo, :presence => true # campo obligatorio +end diff --git a/app/models/trip.rb b/app/models/trip.rb index 4ff6d83..4465c5e 100644 --- a/app/models/trip.rb +++ b/app/models/trip.rb @@ -1,3 +1,12 @@ +# =Código del modelo de Trip +# +# ==Los trips tienen los siguientes campos: +# 1.* name: nombre del trip +# 2.* description: texto para describir el viaje +# 3.* date: fecha del viaje +# 4.* user_id: usuario que ha creado el viaje +# + class Trip < ActiveRecord::Base belongs_to :user has_many :visits diff --git a/app/models/type.rb b/app/models/type.rb index 2284d1f..943a964 100644 --- a/app/models/type.rb +++ b/app/models/type.rb @@ -1,3 +1,9 @@ +# =Código del modelo de Type +# +# ==Los trips tienen los siguientes campos: +# 1.* name: nombre del type +# 2.* description: texto para describir el tipo de sitios asociados +# class Type < ActiveRecord::Base has_many :sites diff --git a/app/models/user.rb b/app/models/user.rb index 35b8159..5dfb68b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,10 @@ +# =Código del modelo de User +# ==Tiene todos los campos que nos crea la gema de Devise class User < ActiveRecord::Base has_many :sites has_many :trips - + has_many :comments, :dependent => :destroy # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, diff --git a/app/models/visit.rb b/app/models/visit.rb index 57546da..ad8df35 100644 --- a/app/models/visit.rb +++ b/app/models/visit.rb @@ -1,3 +1,12 @@ +# =Código del modelo de Visit +# +# ==Una visita tiene los siguientes campos: +# 1.* name: nombre +# 2.* hora_asociada: Hora a la que se le asocia la visita +# 3.* trip_id: Trip al que está asociado +# 4.* site_id: Sitio al que está asociado + + class Visit < ActiveRecord::Base belongs_to :trip belongs_to :site diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb new file mode 100644 index 0000000..f2b7244 --- /dev/null +++ b/app/views/comments/_comment.html.erb @@ -0,0 +1,12 @@ +
+ <%= comment.user.name %>: + <%= comment.comment %> +
++ <% if (comment.user_id == current_user.id) %> + <%= link_to 'Edit', edit_site_comment_path(@site, comment) %> + <%= link_to 'Destroy', [comment.site, comment], + :confirm => 'Are you sure you want to eliminate the comment?', + :method => :delete %> + <% end %> +
\ No newline at end of file diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb new file mode 100644 index 0000000..03c4c1e --- /dev/null +++ b/app/views/comments/_form.html.erb @@ -0,0 +1,11 @@ +<%= form_for([@site, @site.comments.build]) do |f| %> + +
+
|
+
+ + <% if comment.user == current_user %> + <%= link_to 'Edit', edit_site_comment_path(@site, comment) %> | + <%= link_to 'Destroy', [comment.site, comment], + :confirm => 'Are you sure you want to eliminate the comment?', + :method => :delete %> + <% end %> + | +