title: RAILS - tacking on a message when form is submitted
body: <p>I can't seem to figure this out or find a solution to this anywhere...which is crazy to me since i feel like its pretty common and simple</p>
  
  <p>I want to add a little message that my client will see when the user sends them a request through the form and then it goes to an external API where they can see created tickets.</p>
  
  <p>so right now my client sees </p>
  
  <pre><code> John Doe 
  </code></pre>
  
  <p>but i want them to see </p>
  
  <pre><code> Web inquiry from John Doe
  </code></pre>
  
  <p>So i need to send the "Web inquiry from" part through the form </p>
  
  <p>i've tried to interpolate it in the form </p>
  
  <pre><code> = f.text_field "Web inquiry from #{:subject}"
  </code></pre>
  
  <p>that didnt work </p>
  
  <p>i've tried to add a value (not the way i want to go but i tried it anyway)</p>
  
  <pre><code> = f.text_field :subject, value: "Web inquiry from #{f.object.subject}"
  </code></pre>
  
  <p>that did not work either </p>
  
  <p>i've tried to place it in the model </p>
  
  <pre><code> def post_tickets(params)
     client.subject = "Hello from, " + client.subject
   end
  </code></pre>
  
  <p>I'm new to rails so if you could be specific as possible that would be helpful...please dont say just do it in the controller.....thank you in advanced </p>
  
  <p>here is my form </p>
  
  <pre><code>= form_for(:contacts, url: contacts_path) do |f|
  = f.error_messages
  = f.label :subject, "Name"
  %span{style: 'color: red'} *
  = f.text_field :subject, class: "text_field width_100_percent"
  %br
  %br    
  = f.label "Email"
  %span{style: 'color: red'} *
  %br    
  = f.email_field :email, class: "text_field width_100_percent"
  %br
  %br
  = f.label "Question(s), and/or feedback"
  %span{style: 'color: red'} *
  %br
  = f.text_area :description, class: "text_field width_100_percent", style: 'height: 100px;'
  %br
  %br
  = f.submit "Submit", class: 'btn btn-warning'
  </code></pre>
  
  <p>here is my controller </p>
  
  <pre><code> class Website::ContactsController &lt; Website::WebsiteApplicationController
     def new
       @contacts = Form.new
     end
  
     def create
       @contacts = Form.new(params[:contacts])
       @contacts.post_tickets(params[:contacts])
       if @contacts.valid?
         flash[:success] = "Message sent! Thank you for conacting us."
         redirect_to new_contact_path
       else
         flash[:alert] = "Please fill in the required fields"
         render action: 'new'
       end
     end
   end
  </code></pre>
  
  <p>here is my model </p>
  
  <pre><code> class Form
     include ActiveModel::Validations
     include ActiveModel::Conversion
     include ActiveModel::Translation
     extend  ActiveModel::Naming
  
     attr_accessor :config, :client, :subject, :email, :custom_field_phone_number_28445, 
              :custom_field_name_28445, :custom_field_company_28445, :description, 
              :custom_field
  
      validates_presence_of :subject, :message =&gt; '^Please enter your name'
      validates_presence_of :description, :message =&gt; '^Question(s), and/or feedback can not be blank'
      validates :email, presence: true  
      validates_format_of :email, :with =&gt; /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i
  
      def initialize(attributes = {})
        attributes.each do |name, value|
          @attributes = attributes
        end
  
        self.config = YAML.load_file("#{Rails.root}/config/fresh_desk.yml")[Rails.env]
    self.client = Freshdesk.new(config[:url], config[:api_key], config[:password])
      end
  
      def read_attribute_for_validation(key)
        @attributes[key]
      end
  
      def post_tickets(params)
        client.post_tickets(params)
      end
  
      def persisted?
        false
      end
    end
  </code></pre>