adds association name to spending proposals

This commit is contained in:
rgarcia
2016-02-20 19:21:30 +01:00
parent 93042b7d3e
commit d68ed5228c
7 changed files with 18 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ class SpendingProposalsController < ApplicationController
private
def spending_proposal_params
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :terms_of_service, :captcha, :captcha_key)
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name, :terms_of_service, :captcha, :captcha_key)
end
def verify_valuator

View File

@@ -22,6 +22,11 @@
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
</div>
<div class="small-12 column">
<%= f.label :association_name, t("spending_proposals.form.association_name") %>
<%= f.text_field :association_name, placeholder: t("spending_proposals.form.association_name"), label: false %>
</div>
<div class="small-12 column">
<% if @spending_proposal.new_record? %>
<%= f.label :terms_of_service do %>

View File

@@ -399,6 +399,7 @@ en:
youtube: YouTube
spending_proposals:
form:
association_name: 'Association'
description: Description
external_url: Link to additional documentation
geozone: Scope of operation

View File

@@ -400,6 +400,7 @@ es:
youtube: YouTube
spending_proposals:
form:
association_name: 'Asociación'
description: Descripción detallada
external_url: Enlace a documentación adicional
geozone: "Ámbito de actuación"

View File

@@ -0,0 +1,5 @@
class AddAssociationToSpendingProposals < ActiveRecord::Migration
def change
add_column :spending_proposals, :association_name, :string
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160219172824) do
ActiveRecord::Schema.define(version: 20160220181602) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -302,6 +302,7 @@ ActiveRecord::Schema.define(version: 20160219172824) do
t.boolean "legal"
t.boolean "feasible"
t.text "explanation"
t.string "association_name"
end
add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree

View File

@@ -25,6 +25,7 @@ feature 'Spending proposals' do
fill_in 'spending_proposal_title', with: 'Build a skyscraper'
fill_in 'spending_proposal_description', with: 'I want to live in a high tower over the clouds'
fill_in 'spending_proposal_external_url', with: 'http://http://skyscraperpage.com/'
fill_in 'spending_proposal_association_name', with: 'People of the neighbourhood'
fill_in 'spending_proposal_captcha', with: correct_captcha_text
select 'All city', from: 'spending_proposal_geozone_id'
check 'spending_proposal_terms_of_service'