Question: ```
def create  
    @player = Player.create(player_params)
end

```

Why player\_params is showing "undefined local variable or method `player\_params' for #" ? 

**form:**

```
<%= form_for(@player) do |f|%>
<div class="field">
        <%= f.label :player_name%><br>
        <%=f.text_field :player_name%>
</div>

<div class="field">
    <%=f.label :price%><br>
    <%=f.text_field :price%>
</div>

<div class="field">
    <%= f.label :team_id%>
    <%= f.select(:team_id, options_from_collection_for_select(Team.all,     :id, :team_name),{prompt: 'please choose'}, class: "form-control")%>
</div>

<div class="actions">
<%= f.submit %>
</div>
<% end %>

```

Answer: 
In the context of the "separation of code and UI" discussion, you aren't separating the *Xaml* from the Code-Behind. Rather, you are separating the *logic* from the Xaml and, as a result, separating the *logic* from the *Code-Behind* as well.

When a Xaml control is constructed, not only is the xaml "view" constructed but so also is the backing partial class that initializes the control. As a result, you always have a code-behind. It's a fundamental part of how Xaml works.
There is something wrong in architecture you're talking about. 
You don't need *names of control* in the model data. The only thing model data interacts with are events/commands. In that way you have a separation between presentation and data where the model view is a bridge between those two.