Using Database Values stored as atoms in HTML in Ash Framework

Hello , I am using Ash Framework ,we have a photo resource with the attribute of state which holds the state of the photo, we have it as such , we save them as atoms.

    attribute :state, :atom do
      constraints one_of: [:pending_review, :in_review, :approved, :rejected, :error, :nsfw]

In the HTML , we want to conditionally display images depending on their state , so we have <img :if={@photo.state == :approved} /> , the problem is that this fails , but works if we have it as <img :if={@photo.state == “approved” } /> , what might be causing this? , in IEX if i read that photo , it is seen as :approved

1 Like

This seems strange to me. How are you assigning the photo? And have you looked at your assigns serverside with dbg or something? Is it an atom or a string there?

We have preloaded it with the user / story . So we are taking it as user.photo. etc