How to call a method on a model after a form selection is made
<p>I'm trying to update a model after a selection is made on a selection menu.</p>

<p>If the selection is 'se' for example, I want to call a method that updates the current users profile.</p>

<p>Heres my view:</p>

<pre><code>&lt;h1&gt;Profiles#new&lt;/h1&gt;
&lt;p&gt;Find me in app/views/profiles/new.html.erb&lt;/p&gt;

&lt;%= simple_form_for @profile do |f| %&gt;
&lt;%= f.input :bio %&gt;

&lt;%= select_tag id="postcode"name="Areas Covered"&gt;
    &lt;option value="se"&gt;Southeast London&lt;/option&gt;
    &lt;option value="nw"&gt;  &lt;/option&gt;
    &lt;option value="n"&gt;  &lt;/option&gt;
    &lt;option value="s"&gt;  &lt;/option&gt;
  &lt;/select&gt;
 &lt;br&gt;&lt;br&gt;

&lt;%= f.button :submit %&gt;
&lt;% end %&gt;
</code></pre>

<p>If 'se' is called I'll call the "se_london" helper method:</p>

<pre><code>module ProfilesHelper

    def se_london
        se = Place.where('area2 LIKE ? AND postal_code LIKE ?', '%London%', '%se%')
        @profile.places &lt;&lt; se
    end
end
</code></pre>

<p>I'm trying to call the method on the current user profile but to no avail:</p>

<pre><code>class ProfilesController &lt; ApplicationController
  def new
    @profile = Profile.new

  end

  def create
    @profile = Profile.new(profile_params)
    if @profile.save
      if "value" == se
        @profile.se_london
      end
      redirect_to '/' 
    else
      redirect_to '/'
    end
  end

  def update
  end

  def edit
  end

  def destroy
  end

  def index
    @profile = Profile.all
  end

  def show
  end
</code></pre>

<p>If its relevant, the Place model has a belongs to and has many relationship with the Profile model.</p>