In your case, you CAN'T call "user.avatar.attached?" inside
app/javascript/channels/room_channel.js.erb because it's a request
dependant object.
El mar., 28 ene. 2020 a las 12:24, Ariel Juodziukynas ()
escribió:
> Although you can use .js.erb extension for any .js file you have to
> understand
Although you can use .js.erb extension for any .js file you have to
understand WHEN that erb gets executed to understand what you can do with
it.
Assets with .erb extension are compiled to JS code during the assets
precompilation process, you can't put request dependant code (current_user,
On Monday, January 27, 2020 at 8:28:48 AM UTC-5, Ariel Juodziukynas wrote:
>
> You can't, you need the .erb extension to execute ruby code.
>
> El lun., 27 ene. 2020 a las 0:29, fugee ohu ( >) escribió:
>
>> How would I run this same test in javascript without renaming my
>> room_channel.js to
You can't, you need the .erb extension to execute ruby code.
El lun., 27 ene. 2020 a las 0:29, fugee ohu () escribió:
> How would I run this same test in javascript without renaming my
> room_channel.js to room_channel.js.erb ?
>
> --
> You received this message because you are subscribed to the
How would I run this same test in javascript without renaming my
room_channel.js to room_channel.js.erb ?
--
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
5 matches
Mail list logo