Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails4 strong parameter issue #28

Closed
burtondav opened this issue Nov 19, 2015 · 2 comments
Closed

Rails4 strong parameter issue #28

burtondav opened this issue Nov 19, 2015 · 2 comments

Comments

@burtondav
Copy link

I'm trying to use the type=select in Rails4. But, I'm getting an error in the strong parameters code.

This is the accessory view code:

<td>
  <a href="#" class="xeditable" data-emptytext="Type" data-type="select" data-pk="1" data-resource="accessories" data-source="/accessorytypes" data-name="accessorytype_id" data-url="/accessories/<%= accessory.id %>" data-original-title="Select Type">
    <%= accessory.accessorytype.name if accessory.accessorytype_id != nil %>
  </a>

This is the javascript (coffee) and it works for type=text

$(".xeditable").editable
    placement: 'bottom'

This is the error:

ActionController::ParameterMissing at /accessories/5
====================================================

> param is missing or the value is empty: accessory

app/controllers/accessories_controller.rb, line 88

This is line 88 (strong parameter):

 params.require(:accessory).permit(:user_id, :manufacturer,:manufacture_year, :model, :accessorytype_id, :description, :sold, :count, :bow_id, :note, :sold_id, :archive)
@burtondav
Copy link
Author

I had to change:

From: data-resource="accessories"

To: data-resource="accessory"

On Fri, Apr 29, 2016 at 12:47 AM, Sambhav Sharma notifications@github.com
wrote:

Hi,
did you solve this issue?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#28 (comment)

Regards,
David Burton

@burtondav
Copy link
Author

I had to change:

From: data-resource="accessories"
To: data-resource="accessory"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant