Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to integrate within an existing application? #26

Closed
fmbiete opened this issue Jan 13, 2014 · 8 comments
Closed

Question: How to integrate within an existing application? #26

fmbiete opened this issue Jan 13, 2014 · 8 comments
Labels

Comments

@fmbiete
Copy link

fmbiete commented Jan 13, 2014

Hi,
I cannot seem to get this done, Could you guide me?
I have an existing rails 4 application and I would like to put dashing inside it, but integrating the look and feel.
It would reuse the existing application layout for that:

I have a route like this (controller: graphics, action: server)
/graphics/:id/server
And would like to use dashing to show the server status

It's that possible?

Thank you very much

@gottfrois
Copy link
Owner

I don't think you went the right way. From my point of view, you should setup a dashing-rails dashboard (sample by default is fine) and then simply use dashing-hotness widget to display your server status.

You would go to a route like http://localhost:3000/dashing/dashboards in your rails 4 application (running puma for example).

Does this could work for you ? Please have a look at dashing-rails-demo application.

@fmbiete
Copy link
Author

fmbiete commented Jan 14, 2014

In your dashing-rails-demo, how would you use dashing within the application.html.erb?

I could route to a full dashing, but it would be the same as opening a new windows with it, since a full application already exists (common look and feel, menus, session stored variables...).

@gottfrois
Copy link
Owner

This is the file responsible for rendering the dashing widgets and loading the JS. I did not try to override this layout but you could give it a try by creating this file yourself and add your custom css / html.

https://github.com/gottfrois/dashing-rails/blob/master/app/views/layouts/dashing/dashboard.html.erb#L19

@fmbiete
Copy link
Author

fmbiete commented Jan 14, 2014

I will try it, but yesterday was giving me errors accessing session variables from that file... maybe because it's inside the "module Dashing" and the rest of the application no.

Thank you very much!

@fmbiete
Copy link
Author

fmbiete commented Jan 14, 2014

It doesn't work. I can modify the dashboard.html.erb with my code, but It errors when using routes to my existing controllers. It seems to expect them being defined in the Dashing:: namespace.

Example

<%= link_to show_user_path(session[:userid]) %>
undefined local variable or method `show_user_path' for #<#<Class:0x007f8fc96f9568>:0x007f8fc96f8500>

Any ideas?

@gottfrois
Copy link
Owner

Try:

main_app.show_user_path(session[:userid])

More details here

@fmbiete
Copy link
Author

fmbiete commented Jan 14, 2014

I got it working, thanks!!!

I need to fix some plugins: typeahead, tooltip... also some css. And allow to add widgets to the user...

@fmbiete fmbiete closed this as completed Jan 14, 2014
@gottfrois
Copy link
Owner

I'm glad to hear that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants