How to set a predefined value in a form in Rails
- by marco
So I just got started in Rails, and I'm trying to create an Object (a book_loan in my case) with a Form. The thing is that I get to this form by clicking on a book, so I pass the book_id as a parameter, like localhost:3000/loans/new?id=1.
Now I don't want the user to be able to set the book id field in the form, since I already know the id. So my…