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
158 Views Asked by mara At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- Rails HABTM: Select everything a that a record 'has'
- Best way to make an HABTM association via console
- dynamically create an ical / ics file from a rails model
- Ruby destroy is not working? Or objects still present?
- NoMethodError: undefined method `update_average_rating' for nil:NilClass
- Select results where joined table contains records with an attribute, but without another
- Showing posts only created when boolean was true
- Ruby on rails and HAML - Print a hash with background color
- How can I monitor an endpoint's status with Ruby?
- How to create dynamic pages without form_for helper in Rails?
- Rails 4.2 jQuery loads only after refresh
- "Access Denied" - User's Permissions to S3 Bucket
- ActiveRecord, Rails 4: has_many :through with scoped conditions failure
- Rails - formatting a list of options
- Rails - Ajax do not work properly on production server
Related Questions in SIMPLE-FORM
- Two Association Label Elements in Simple Form
- Rails: Customising SimpleForm Association Wrapper
- Rails - Simple Form & Nesting models
- How to set default value for association with simple_form?
- Editing multiple objects with simple_form
- Rails 4 -Nested Models and Simple Form partial
- Rails - Simple Form - Money-Rails gem - show selection on edit
- Rails 4 - Simple Form & Rails-Money, null value
- Show selected option in dropdown on edit in Rails Simple Form
- Hide label in certain resolution with simple_form
- How to properly display value in edit form while using bootstrap3_autocomplete_input and association
- Rails - Simple Form - style error messages
- Rails - toggle boolean on click of a link
- Rails 4 Attempting to save Multiple Records to single Model
- Rails, Simple Form, Nested Forms
Related Questions in SELECTLIST
- Cannot get list for dropdownfor (to edit model)
- Remove item from SelectList in C#
- Only show certain options in second drop down list
- C# MVC 5 - Create a SelectList For Dates Doesn't Work
- ASP NET MVC 5 SeletList DropDownList
- String Formatting for SelectList
- How to keep the id from the selectlist when using multiple columns in the textfield
- MVC DropDownList selected value not working
- MVC 5 DropDownListFor Database Linq;
- jquery trigger function based on select list
- SelectList Not Coming Back Sorted - C# MVC 3
- Why Is The Selected Value Different Between Using Route ID and Action Parameter in SelectList
- Element always on top
- Filtering SelectList for one element but not others
- format the items in a selectlist
Related Questions in OBJECT-ADDRESS
- C# address Button using a string
- WINAPI ReadProcessMemory always same address
- How to find the address belongs to the kernel
- gnu assembler: get address of label/variable [INTEL SYNTAX]
- How to assign address of a struct to another struct?
- Get symbol by address (symbolicating binary, iOS build)
- True address of object's method
- Is there a Python module for handling Python object addresses?
- Address of the pointed element whatever the iterator type/pointer is passed
- Adding Base Address + Offsets to Modify Value
- C++ - When function inlining is not possible?
- How to get address of a Java Object?
- How to print String instead of address in Java?
- Rewrite document.location without loading
- Uniform way to get object address or NULL in global function
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)
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?
Please check that your ProductAssignment model defines a to_s instance method, returning the attribute you want to display.