These are chat archives for mithriljs/mithril.js

10th
Aug 2017
jesser360
@jesser360
Aug 10 2017 00:06
hello, does anyone have any experience using mithril on a rails app?
im having trouble getting my views and models to connect, thank you
cavemansspa
@cavemansspa
Aug 10 2017 01:18
@jesser360 -- can you provide more detail on the issue? mithril should be pretty agnostic on what server side system / framework being used.
jesser360
@jesser360
Aug 10 2017 16:45
hi, some of the functions throw errors- such as m.component as well as when I try to require mithril in my files.
I also have not been able to find a way a to import my model into my view, and cannot CRUD it
does anyone know of other mithril on rails projects i might be able to look at for some inspiration, cheers :)
Stephan Hoyer
@StephanHoyer
Aug 10 2017 17:07
Does rails frondend js?
cavemansspa
@cavemansspa
Aug 10 2017 17:13
@jesser360 -- what version of mithril are you expecting in your page? m.component() was in 0.2, and the current mithril version is 1.0+ which no longer has m.component
Patrik Johnson
@orbitbot
Aug 10 2017 17:14
also, mithril isn't a serverside framework per se, even though it can probably be used as such if you'd like
Raden Muhammad
@RadZaeem
Aug 10 2017 18:40
any example of using redux in mithril?
jesser360
@jesser360
Aug 10 2017 20:08
ahh thank you @cavemansspa . I was wondering why it wouldnt work
Right now Im trying to get it to create new instances of my models, which has been a tricky asset pipeline issue
i am using mithril on a rails backend
cavemansspa
@cavemansspa
Aug 10 2017 20:25
@jesser360 -- i'd expect everything to work fine with rails and asset-pipeline. do you have anything more specific on the problem. we can try to help you get going but will need more details on what you're doing and errors you're getting.
jesser360
@jesser360
Aug 10 2017 20:30
@cavemansspa I am trying to sync information with my server using mirthril. I have a models and components folder and I am trying to bring in a new instance of my model into my components.js view files, so I can CRUD information about this instance and relay the info back to the server.
cavemansspa
@cavemansspa
Aug 10 2017 20:33
what error are you getting?
jesser360
@jesser360
Aug 10 2017 20:38
Uncaught Error: Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.
cavemansspa
@cavemansspa
Aug 10 2017 20:42
which one are you using (m.route, m.render, m.mount) and how are you obtaining the element that you pass as the first param?
jesser360
@jesser360
Aug 10 2017 20:54
I am using mount.. which is displaying all of the inputs but when I try to set those input values to affect the model, it breaks