Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mitch VanDuyn
    @catmando
    no to figure out what is going wrong...
    ...
    you have a typo in your code:
    Button(value: state.squares[i]).on(:on_handle_click)do
    that should be .on(:handle_click) do
    Karan Sharma
    @karansharmaufl
    Thanks that fixed it. I had to add on_ while declaring only the param.
    Mitch VanDuyn
    @catmando
    yeah and perhaps the code you pasted was not exactly the same.
    Karan Sharma
    @karansharmaufl
    Sorry my bad. But thanks a lot I really appreciate your help.
    Mitch VanDuyn
    @catmando
    I don't know if you care, but you can get rid of the controllers and the views
    if you just put this in your routes file:
      # root 'game#board'
      root 'hyperloop#board'

    the built in hyperloop controller will automatically render Board as your top level component

    But its not important for now...

    Karan Sharma
    @karansharmaufl
    Okay. I'll keep that in mind.
    Mitch VanDuyn
    @catmando
    @karansharmaufl by the way you seem to understand how states work (probably from your react.js days). Hyperloop makes state management a bit easier. You can just say this:
        def click_event(i)
          mutate.squares[i] = 'X'
        end
    Karan Sharma
    @karansharmaufl
    I am trying to save a score for a game in the user table which is created by the devise gem. How can I access my user from my component? Can you help me with this.
    Mitch VanDuyn
    @catmando
    Move your user model to hyperloop/model directory
    Recommend a quick read through of one of the tutorial s using models
    Karan Sharma
    @karansharmaufl
    I have followed the tutorial. But somehow I can not access the current_user helper that devise offers.
    Mitch VanDuyn
    @catmando
    Ahh sorry to misunderstand
    Just add this to your application controller
    alias acting_user current_user
    Karan Sharma
    @karansharmaufl
    if winner
            message = "#{winner} Win's"
            #@user=current_user
            @user.update(score: 10)
          else
            if state.next_turn 
              message = "X's Turn"
            else
              message = "O's Turn"  
            end
            if draw
              message = "XO - Tie"
            end
          end
    I have initialized the user to @user=acting_user in the before_mount method. But I still keep getting the same error after adding the alias.
    Mitch VanDuyn
    @catmando
    I'll be Online later today and can give a more detailed explanation.
    Karan Sharma
    @karansharmaufl
    Cool thanks.
    Karan Sharma
    @karansharmaufl
    @catmando i am hoping if you could explain me in detail the issue we were talking about related to devise's helper current_user.
    Mitch VanDuyn
    @catmando
    Sure... I am actually (finally) online, and at my desk, and have a some time right now, if you want to chat.
    Karan Sharma
    @karansharmaufl
    Yes definitely.
    Mitch VanDuyn
    @catmando
    Could we move the discussion here: https://gitter.im/ruby-hyperloop/chat
    Karan Sharma
    @karansharmaufl
    yes
    Mitch VanDuyn
    @catmando
    (not many people find there way to this room)
    and we have not found how to auto-redirect to the right place.
    Karan Sharma
    @karansharmaufl
    Alright. Should i post my question again?
    ortolane
    @ortolane_twitter
    run code jquery
    ortolane
    @ortolane_twitter
    semantic-ui hyperloop?
    How to make: $(document)
    $(document).ready(function () {
    $('.ui.selection.dropdown').dropdown();
    $('.ui.menu .ui.dropdown').dropdown({
    on: 'hover'
    });
    });
    Mitch VanDuyn
    @catmando
    @ortolane_twitter please ask again in the main chat
    Ruby-hyperloop/chat
    Nobody used this one, but we can't hide it
    Anton
    @AntonAL

    Hello everyone!
    I've just installed Hyperloop to my existing Rails application.
    Folloing an official guide, I've generated a blank component rails g hyper:component Helloworld and want to render it.

    When I try to render it in a Slim view, this way:

    = react_component 'HelloWorld'

    I'm getting following errors:

    Exception raised while rendering #<React::TopLevelRailsComponent:0x686>: Can't find variable: ActionCable

    Exception raised while rendering #<React::TopLevelRailsComponent:0x686>: Could not find component class 'HelloWorld' for params.controller 'Apartments' in any component directory. Tried [Apartments::HelloWorld, Components::Apartments::HelloWorld, HelloWorld, Components::HelloWorld]

    Everyone has faced this issue?

    I don't have any top-level components. I just want to replace some static parts of my web-app with React.
    Jasper
    @jkingharman
    Hi - I'm new to the group and thought I'd introduce myself. I work with Simon and will be checking in here occasionally
    mareczek
    @mareczek
    Hi @jkingharman , pleasure to meet you :)
    Mitch VanDuyn
    @catmando
    @jkingharman - FYI main chat area is here: https://gitter.im/ruby-hyperloop/chat welcome aboard
    Aaron Chung
    @AaronCLH
    Hi - I'm new to the group and would like to introduce myself. I am Aaron and my company is hoping to integrate ruby-hyperloop with an existing Rails 5.1 app. Currently, we are trying to implement the React code in a portion of a single app application. While the Helloworld component works fine by itself, I have trouble rendering it to an existing view using '<%= react_component "::Helloworld" %> ' or '<div data-hyperloop-mount="::Helloworld"></div>' as suggested in the documentation (http://ruby-hyperloop.org/tutorials/hyperlooprails/helloworld/ ). No error is found and there is nothing rendered on the webpage except for an empty html tag. Any advice would be appreciated, thanks.
    Mitch VanDuyn
    @catmando
    @AaronCLH welcome aboard.. the main chat is here. Please repost your question there for best response! https://gitter.im/ruby-hyperloop/chat (its just a weird thing the way gitter works... sorry)
    Aaron Chung
    @AaronCLH
    Thanks @catmando
    ylluminate
    @ylluminate
    @catmando might make a good base/ template for a Hyperloop course: https://www.udemy.com/the-complete-react-fullstack-course/
    Orban Botond
    @orbanbotond

    Hi Guys,

    How can I access the current_user on the client (browser) side. I’ve made an authentication with devise.
    This just doesn’t work:

      def self.current
        Hyperstack::Application.acting_user_id ? find(Hyperstack::Application.acting_user_id) : User.new
      end
    # app/hyperloop/components/helloworld.rb
    DIV do
      H1 {"Helloworld - #{User.current.email}"}
    end

    I receive:
    message: "User.current() (called class method missing)”

    Mitch VanDuyn
    @catmando
    I'm answering over on the main chat, for everyone's benefit: