On Sunday, January 5, 2020 at 8:41:33 AM UTC-5, Ariel Juodziukynas wrote:
>
> No, the first line is ruby and the convention is snakecase so it's ok you
> use underscores, the second line is html and the attributes syntax is
> hyphen, when you access that data attribute with javascript it will
data attributes (data-something on an html tag) are accessed using the
"dataset" property of javascript's HTMLElement element
https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/dataset
, that "received(data)" sounds like a callback from a promise or ajax call
to me, that's a
On Sunday, January 5, 2020 at 8:41:33 AM UTC-5, Ariel Juodziukynas wrote:
>
> No, the first line is ruby and the convention is snakecase so it's ok you
> use underscores, the second line is html and the attributes syntax is
> hyphen, when you access that data attribute with javascript it will
On Sunday, January 5, 2020 at 8:41:33 AM UTC-5, Ariel Juodziukynas wrote:
>
> No, the first line is ruby and the convention is snakecase so it's ok you
> use underscores, the second line is html and the attributes syntax is
> hyphen, when you access that data attribute with javascript it will
On Sunday, January 5, 2020 at 8:41:33 AM UTC-5, Ariel Juodziukynas wrote:
>
> No, the first line is ruby and the convention is snakecase so it's ok you
> use underscores, the second line is html and the attributes syntax is
> hyphen, when you access that data attribute with javascript it will
No, the first line is ruby and the convention is snakecase so it's ok you
use underscores, the second line is html and the attributes syntax is
hyphen, when you access that data attribute with javascript it will be
dataset.conversationWithId as camelcase. You should write using the
convention of
<%= content_tag :div, id: "message_holder", data: {conversation_with_id:
@conversation_with.id} do %>
translates to this html from page source:
The underscores get translated to hyphens Should I just rename the variable to
conversation-with-id ?
--
You received this message because you are
7 matches
Mail list logo