Continuation ・ Active hash that can be handled as data even if it is not in the database ~ Display

Introduction

For how to use ActiveHash, please refer to the previously posted here.

How to retrieve ActiveHash strings

When you want to display the data saved in ActiveHash in the view, only the column name will display the numerical value.

ex)


item.prefecture.name

If you add name after the column name, the character string associated with id will be displayed.

Recommended Posts

Continuation ・ Active hash that can be handled as data even if it is not in the database ~ Display
An active hash that can be treated as data even if it is not in the database
Even if I write the setting of STRICT_QUOTE_ESCAPING in CATALINA_OPTS in tomcat8.5, it is not reflected.
Isn't it reflected even if the content is updated in Rails?
Even though the property file path is specified in the -cp option, it is not recognized as a classpath.
If you get the error The data ca n’t be read because it is missing in docker for mac
Setting method that the size does not change even if CSS is changed
[Rails] If CSS is not applied in collection_select, check if class can be specified.
Try to save the data that can be read by JavaFX as PNG
The problem that the JDK set in JAVA_HOME does not appear even if java -version is performed at the command prompt
Processing when an ID that does not exist in the database is entered in the URL
If hash [: a] [: b] [: c] = 0 in Ruby, I want you to extend it recursively even if the key does not exist.
[Quarkus] A trap that doesn't work even if you copy and paste the GCP Pub / Sub sample as it is
Directory is not created even if directory task is described in Rakefile
The case that @Autowired could not be used in JUnit5
Enter line breaks in rails text_area → display as it is.
[Firebase] The problem that the currentUser of Firebase Auth does not become null even if the app is uninstalled.
Solved the phenomenon that "Response time is too long" in the original domain even though the IP address and EC2 address can be entered in the site.
[Rails] What to do if data is not registered in DB
Like function The part that is stuck in making it asynchronous
It seems that data class-like functions will be added in Java14
Pay.JP Solution when it can be done locally but it does not work well in the production environment
How to solve the problem that it is not processed normally when nesting beans in Spring Batch
I separated the same description as a method under private in Rails controller and implemented it so that it can be called by before_action