Skip to content

Instantly share code, notes, and snippets.

@crova
Created December 6, 2017 20:46
Show Gist options
  • Select an option

  • Save crova/3cdf069c81cfdf80ccadf809c18b1bb8 to your computer and use it in GitHub Desktop.

Select an option

Save crova/3cdf069c81cfdf80ccadf809c18b1bb8 to your computer and use it in GitHub Desktop.
Getting error on Segments#new
NoMethodError in Segments#new
Showing /home/crova/Shelter/Dev/the-nuclear-shelter/app/views/segments/_form.html.erb where line #16 raised:
undefined method `segment' for #<Segment id: nil, created_at: nil, updated_at: nil>
Extracted source (around line #16):
14
15
16
17
18
19
<div class="field">
<%= f.label :segment %><br>
<%= f.text_field :segment %>
</div>
<div class="actions">
<div class="field">
<%= f.label :segment %><br>
<%= f.text_field :segment %>
</div>
# GET /segments/new
def new
@segment = Segment.new
end
def segment_params
params.fetch(:segment).permit(:segment)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment