Rails plugin, possible customize styelsheet? - ruby-on-rails

could I have a stylesheets directory in Rails' plugin directory?
I am trying to write plugin for a existing Rails webApp, but still not sure how to customize
the default CSS for my plugin?

I have a example for this .
Please Reffer in rails ck editor.
IN rails-ck-editor they will give the css and javascripts in plugin itslef .
By running task we ca get the css files.
Please find the task file in the following path (vendor/plugins/rails-ckeditor/tasks/ckeditor_tasks.rake)
You can use this task according to you.
the rails-ck-editor link is
http://github.com/standout/rails-ckeditor
I suggest this only for your reference.
Thanks & Regards,
Ramanaa Selvaa

The typical way is to write a generator in your plugin that copies your custom stylesheet into a special public/stylesheets/you directory in the main app. Then the generator prints out instructions to include the plugin stylesheet in the layouts.

Related

How to deploy angulardart 5.2 properly for production?

on the angulardart official website, I can not find any docs related to production deployment. I prefer command line way, so far I find out I can do webdev build to generate a build/ directory. But there are still some more questions:
I want to clarify what files I should deploy to the production server. I think they should be favicon.ico, index.html, main.dart.js, styles.css 4 files, right?
Why does it generate .build.manifest, .packages, packages/? two files and one directory which contains many directories and files. They are just confusing me. This is for production. Why do I ever want to have those files? Should I write a deploy script to simply auto-remove them?
It seems the generated main.dart.js is a minimized js file. But why are there many useless newlines in it? How to get rid of those useless newlines properly by using angulardart way? I can do that with gulp, but I don't want to use gulp if dart can handle this.
How to minimize html and css files properly by using angulardart way? for example, index.html and styles.css. Again, I can do that with gulp, but I don't want to use gulp if dart can handle this.
Thank you very much for your help.
Here you can find some of official doc :
https://webdev.dartlang.org/angular/guide/deployment

Grunt and Rails

I'm working on using a Grunt workflow to manage my assets in my Rails app rather than Sprockets.
So far, I have my apps JS and CSS both being concatenated and minified into public/assets/javascripts/application.js and public/assets/stylesheets/application.css respectively.
And also have my Bower components JS and CSS being concatenated and minified into public/assets/javascripts/vendor.js and public/assets/stylesheets/vendor.css respectively.
Fonts and Images from Bower components are then copied into public/assets/(images|fonts).
This is all well and good but now I need the references to fonts/images within those files to be updated to reflect their new location.
I have looked at cssmin and yes it rewrites file references but I cannot get the file path to change depending upon the type of file being referenced.
Any ideas on how I can do this?
Also, I ahve been reading about Grunt plugins which can read your view files and use those to minify and concatenate files and update the and tags in the views for you.
Surely I can't do that in a Rails app? Is there a way I can deal with this in Rails?
This other StackOverflow post may be of help:
Integrate Grunt into Rails asset pipeline
The accepted answer recommends using the Half Pipe gem.
The second answer linked to a blog post about a Do-It Yourself solution: Goodbye, Sprockets! A Grunt-based Rails Asset Pipeline.
I haven't used either solution, but they are worth a try.

How to create a grails plugin that provides assets to the main project

I want to create a grails plugin that will have assests that can be used in the projects it's used
Assets: JS, CSS and Images
Okay, then have at it. The Twitter bootstrap plugin does this and you could use it as a guide on how to do so.

How to edit twitter bootstrap files in rails?

I'm trying to find the twitter-bootstrap files in my rails app ('bootstrap-sass', '2.0.0'), as I need to make a change directly to the bootstrap-responsive.css file, however, I can't find it.
I have bootstrap up and running, but can't seem to find the bootstrap files. How do I locate the bootstrap-responsive.css file?
Thank you!
The bootstap-sass gem uses the Rails 3.2 asset pipeline to inject the necessary stylesheets into your app. The actual stylesheet files are located in the gem installation directory, not in your project itself.
Depending on what you want to change, you can either:
Copy the _bootstrap-responsive.scss file from the gem into your app/assets directory and edit it there.
Customize the necessary Bootstrap variables before loading up Bootstrap in your application.scss file:
$btnPrimaryBackground: #f00;
#import "bootstrap";
Edit: Try looking under
app/assets/stylesheets
Here's an example
https://github.com/joliss/solitr/tree/master/app/assets/stylesheets
I'm not too familiar with the structure of rails apps but did you create a local copy or are you using the bootstrap files being hosted directly by github? You should be able to figure that out by checking one of your launched html pages and viewing the source, looking for something like
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css">
If it's a local page, there should be a directory somewhere in your rails app where the files are stored - perhaps there's a 'static' folder or something similar? Try file-searching for it, good chance you might find it.
(I use Django/Python for web projects but I'll look into Rails a bit and see if I find anything)

Grails fixture plugin how to load fixtures from an inline plugin?

we have an application that uses a centralized domain using an inline plugin. We where using bootstrap data so all of our applications that use the domain could use the bootstrap. Now when using the Fixture plugin we run into the problem that it wants to read the fixture files from a location inside application instead of the shared inline plugin. All .load() methods look for a fixture file inside the application.
Is there a way of loading the fixture files from a central place instead of the fixture directory inside the application?
Currently this is not possible.
See Grails Jira issues:
http://jira.grails.org/browse/GPFIXTURES-16
I had the same problem so I created a config value that allows you to set a config value.
This commit should do the trick, but it's not merged into the plugin (yet):
https://github.com/nwittstruck/grails-fixtures/commit/1cea0da7bf32303885cc536fe89bb9be483375bc

Resources