Ruby on Rails
Friday, May 22, 2015
Walter, Stewart.... Many thanks to you. Definitely making so much progress here.
All seems to be going really well, but I remain stumped at a critical point
Given the model, I pass from the controller @parent = Parent.object
All of the field_for aspects are working really beautifully. But in the view I need to test for a parent/child value. I know that this code is wrong:
<% unless @lenders.state_id_string.blank? %> ## @lenders is the parent model, and only the fields within that model are being returned. I thought that if I define all parent associations in the AR, then the object @lenders would be aware..
## I need to learn whether the parent with address value has state_id_string blank?
## I'm stuck. How do I do this?
<% display_state_id_string = 'inline' %>
<% else %>
<% display_state_id_string = 'none' %>
<% end %>
Thanks,
Liz
On Friday, May 22, 2015 at 8:36:11 AM UTC-4, Elizabeth McGurty wrote:
-- All seems to be going really well, but I remain stumped at a critical point
Given the model, I pass from the controller @parent = Parent.object
All of the field_for aspects are working really beautifully. But in the view I need to test for a parent/child value. I know that this code is wrong:
<% unless @lenders.state_id_string.blank? %> ## @lenders is the parent model, and only the fields within that model are being returned. I thought that if I define all parent associations in the AR, then the object @lenders would be aware..
## I need to learn whether the parent with address value has state_id_string blank?
## I'm stuck. How do I do this?
<% display_state_id_string = 'inline' %>
<% else %>
<% display_state_id_string = 'none' %>
<% end %>
Thanks,
Liz
On Friday, May 22, 2015 at 8:36:11 AM UTC-4, Elizabeth McGurty wrote:
THANKS! Sorry I responded to Walter before I read this
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e4f0866d-4985-4b2e-a99a-6fd406e44775%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment