In RoR I'm not running the .coffee code

0

I am designing a social network and I want that when the user clicks on any of his posts, the option to edit or delete the same appears, these options are in a div, and what I intend to do can be done with a style and with the .coffee file as follows: in style I have the following: / what igue is so that the options to edit and delete are not displayed / .status .admin {   display: none; }

/ when the hover action occurs within the admin section / / works with js, and so, you can see the options to edit and delete / .status.hover .admin {   display: inline; }

Now, in a file called statuses.coffee, I have the following: $ - >     $ ('. status'). hover (event) - >     $ (this) .toggleClass ("hover")

but this is not working for me, you certainly do not see the edit or delete options, but when I click on any of the posts I do not see those options. If you think you can do it in another way without using the .coffee file it would be very helpful, although I prefer that you can work with it, because later on, I will need to use it. thank you very much

    
asked by Juan Carlos Aldana 01.01.2017 в 07:17
source

1 answer

0

Possible solutions:

  • Most basic, but have you added coffee-rails to your Gemfile ?
  • Have you checked that the javascript generated in your browser does appear the code you wrote?
  • How are you adding your code to your coffeescript file? The usual is to do it as follows:
 $(document).ready ->
    // Tu código

Anyway, the usual thing is that if you have a problem, you must add your code. So if none of this solves your problem, add your code, because with the information you give, it's not enough to solve your problem.

    
answered by 02.01.2017 в 18:14