Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-07 Thread fugee ohu


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 be 
> dataset.conversationWithId as camelcase. You should write using the 
> convention of the language you are using, then each language takes care of 
> converting it.
>
> El dom., 5 ene. 2020 a las 4:35, fugee ohu ( >) escribió:
>
>> <%= 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 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
>>  
>> 
>> .
>>
>
>> No, the first line is Ruby ... The second line is html 
Can you please show me the first and second lines that refers to, I see you 
gave me the answer but I forgot what was the question

Also when javascript is included on the html.erb page in 

Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-05 Thread Ariel Juodziukynas
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 totally different thing.

Camel case has two variants: first letter can be lower or upper case (camel
case with capital first letter is also known as PascalCase)

I respond via emails, I guess you delete the post on the google groups page
but the email is already sent.

El dom., 5 ene. 2020 a las 20:17, fugee ohu () escribió:

>
>
> 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 be
>> dataset.conversationWithId as camelcase. You should write using the
>> convention of the language you are using, then each language takes care of
>> converting it.
>>
>> El dom., 5 ene. 2020 a las 4:35, fugee ohu ()
>> escribió:
>>
>>> <%= 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 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 rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
>>> 
>>> .
>>>
>>
> How are you able to reply after I've deleted my original post It's a
> pattern in here, whenever I delete a post I get a repsonse to a post that I
> already deleted It lends the impression that I've been deleting them after
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/cec31578-1a7e-47e3-ba2b-a7edfa50d98e%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcAH%3D%2BMLreTA3raZh7Vvhi6SMeE8uQXyCB2J3wT3-menHA%40mail.gmail.com.


Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-05 Thread fugee ohu


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 be 
> dataset.conversationWithId as camelcase. You should write using the 
> convention of the language you are using, then each language takes care of 
> converting it.
>
> El dom., 5 ene. 2020 a las 4:35, fugee ohu ( >) escribió:
>
>> <%= 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 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
>>  
>> 
>> .
>>
>
How are you able to reply after I've deleted my original post It's a 
pattern in here, whenever I delete a post I get a repsonse to a post that I 
already deleted It lends the impression that I've been deleting them after 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/cec31578-1a7e-47e3-ba2b-a7edfa50d98e%40googlegroups.com.


Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-05 Thread fugee ohu


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 be 
> dataset.conversationWithId as camelcase. You should write using the 
> convention of the language you are using, then each language takes care of 
> converting it.
>
> El dom., 5 ene. 2020 a las 4:35, fugee ohu ( >) escribió:
>
>> <%= 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 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
>>  
>> 
>> .
>>
>
In my case, since I used   `received(data) {`  do you mean dataset or data ?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/cc4dc30a-d0be-4df7-9ecb-450bc88669a1%40googlegroups.com.


Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-05 Thread fugee ohu


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 be 
> dataset.conversationWithId as camelcase. You should write using the 
> convention of the language you are using, then each language takes care of 
> converting it.
>
> El dom., 5 ene. 2020 a las 4:35, fugee ohu ( >) escribió:
>
>> <%= content_tag :div, id: "message_holder", data: {conversation_with_id: @
>> conversation_with.id} do %>
>>
>> translates to this html from page source:
>>
>> 
>>
>> Camel case beginning with lower case? 

>
>> The underscores get translated to hyphens Should I just rename the variable 
>> to conversation-with-id ?
>>
>> -- 
>> 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 rubyonra...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2c32a917-4ab1-4ee8-87cd-719d8a620622%40googlegroups.com.


Re: [Rails] how to pass data to javascript in div.content_tag

2020-01-05 Thread Ariel Juodziukynas
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 the language you are using, then each language takes care of
converting it.

El dom., 5 ene. 2020 a las 4:35, fugee ohu () escribió:

> <%= 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 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcAcAcc69FuYqsjQD%3DZof8BaxzdiysqkZ8fABLXSOTH_Tw%40mail.gmail.com.


[Rails] how to pass data to javascript in div.content_tag

2020-01-04 Thread fugee ohu
<%= 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 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/8da006ce-97eb-49d2-aa3f-b2226c8f0ef5%40googlegroups.com.