I am using a has_many through relationship for project_assignment, expence_types and assignment_expences tables.
I my simple form for adding new expences, i have:
<%= f.association :project_assignment, prompt: 'choose...', collection: ProjectAssignment.where('active = ?', true).order(:task) %>
This should show task description from field task (table project_assignments) but it returns an object address.
I have another example on this same form:
<%= f.association :expence_type, prompt: 'choose...', collection: ExpenceType.where('active = ?', true).order(:name), right_column_html: { class: 'col-md-1 col-lg-1' } %>
That works just fine. Shows the name. I've read that it shows addresses when converting object to string, but I can't make this to work.
Any help would be appreciated.
Select field in Rails simple form gem returns object (hex) address
159 views Asked by mara At
1
There are 1 answers
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in SIMPLE-FORM
- how to disable simple_form validation in rails 7
- Why doesn't this has_many :through collection_check_boxes form input not create the records correctly?
- refactor simple_form form radio-button field
- Rails asterisk/"*" not appearing in one label of a form
- Assign id to simple form collection options
- Simple form not passing parameter to controller RAILS
- How to assign start and end date from range using Flatpickr in Ruby on Rails
- How to disable model validation pass check when showing a disabled element in simple form
- Nested forms regarding association belongs_to
- Google sheet cell delete at specific date
- Rails: Show error messages in fields_for with store_accesor (json)
- How to pass a selected value from a simple_form to Stimulus controller
- simple_form is not capturing Rails Stimulus controller
- How to format the input for time (with nanoseconds) in ruby on rails?
- Simple_form buttons disabled
Related Questions in SELECTLIST
- Cant Figure out what goes wrong in model binding ASP.NET Core + Razor Pages
- Extracting items from 02 SelectListItem to show only unique Items in two selectlist
- System.InvalidOperationException: Nullable object must have a value. can't get SelectList count
- Is it possible to highlight the previous selected values of a Blazorise Select List?
- C# MVC Dropdownlist using IEnumerable Visualizer
- How can I show more than 5 options in a select list dropdown opens .NET Core View
- SelectList from Entity List
- ASP.Net Core 6 problem when use SelectList
- How to post data to an Asp.net razor page app
- One select list consisting of two classes
- Passing value to select list in ASP.net
- How to pass a list from controller post action to a view without using Json?
- Putting data from two tables into one ViewData
- Set different colors in SelectList
- DropDownList focuses when Submitting Modal - MVC
Related Questions in OBJECT-ADDRESS
- Select field in Rails simple form gem returns object (hex) address
- Address of the pointed element whatever the iterator type/pointer is passed
- Get symbol by address (symbolicating binary, iOS build)
- How to assign address of a struct to another struct?
- Obtaining address locations of an overload method
- no heap allocated memory (kernel address)
- How to find the address belongs to the kernel
- WINAPI ReadProcessMemory always same address
- C# address Button using a string
- How to print String instead of address in Java?
- True address of object's method
- jQuery: how to address a sub item with a special class
- Adding Base Address + Offsets to Modify Value
- C++ - When function inlining is not possible?
- Uniform way to get object address or NULL in global function
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Please check that your ProductAssignment model defines a to_s instance method, returning the attribute you want to display.