i just installed the rails_admin admin gem to my existing rails app. Now i am wondering how do i add redcloth and/or ckeditor to it. When i add ckedtor, it just shows the description area and does not show the title and other fields. Also it does not format after saving. How do i edit the necessary files ?
Thanks
If it doesn't show buttons, it isn't the CKEditor, but the default text area, meaning insert CKEditor failed.
Things to check:
Make sure you set it on the fields, like so:
https://github.com/sferik/rails_admin/wiki/Text
Make sure you are using the correct gem version for your Rails (<3, >=3, >=3.2)
https://github.com/galetahub/ckeditor
Make sure you ran the generator, e.g.:
rails g ckeditor:install --orm=active_record --backend=carrierwave
Finally, check your browser console for errors.
Related
I'm doing a Rails application with gem 'kaminari'.
Like in the given screenshot below,
all links in generated pagination starts with
localhost:5000
but i need to modify it and change,
localhost:5000 to something like => https://new_domain and the rest of the url to follow....
Or set the HOST like in default_url_options.
Please help!
If you want customize look in kaminari first generate pages which kaminari. Run below generator
rails g kaminari:views default
then edit the partials in your app's app/views/kaminari/ directory.
I want to customize the controller views generated by haml-rails. According to the Rails guide I am supposed to put my customized templates (e.g. index.html.haml) into lib/templates/[subfolders].
In this case I tried several subfolders (e.g. lib/templates/haml/scaffold, lib/generators/haml/scaffold/templates) but I could not get my custom templates to be used.
I know that I could write another generator easily, but I am wondering if there is a more DRY way to do so. In theory it should be possible:
In Rails 3.0 and above, generators don't just look in the source root for templates, they also search for templates in other paths.
I am using Rails (4.2.5.2), haml (4.0.7) and haml-rails (0.9.0).
Holy moly. It worked after all. It is correct to put the templates into lib/templates/haml/scaffold. And now comes the catch: spring will cache the templates. Hence, you must either restart spring after changes or prepend DISABLE_SPRING to the generator command:
DISABLE_SPRING=true rails g scaffold ...
i'm using devise for authenticate the users in my rails app, i've exported the views by using the comand
rails generate devise:views
i see that the files have a 'blank style' so how i can do for apply to them a mine custom file css?
Add gem in your Gemfile
gem "twitter-bootstrap-rails"
visit link for reference
https://github.com/seyhunak/twitter-bootstrap-rails
http://getbootstrap.com
You can find the generated devise view files in app/views/devise.
Just add needed html elements/css classes the same way you would to other view files.
Keep in mind that this will use your default(application.html.erb) layout.
Probably not the best way, but it works and it's not too messy:
devise uses the global application.scss styles by default.
So I just create a login.scss, signup.scss, etc. in my route assets/stylesheets directory and the add #import "login.scss" at the end of application.scss.
Just make sure these page are imported after whatever global styles you want to make sure they inherit.
Note:
As my application expands I usually end up abstracting everything into distinct stylesheets so my application.scss ends up being a list of imports anyway.
I'm sure there are better ways to do this, but this was the "I'm just a designer and need this to work without overcomplicating things" way,
Installation
Add this line to your application's Gemfile:
gem 'devise-bootstrap-views'
And then execute:
$ bundle
Add some minor css fix to your rails asset pipeline manifest
SASS
*= require devise_bootstrap_views
LESS
*= require devise_bootstrap_views_less
rails g devise:views:bootstrap_templates
If you want to go through in detail , you can refer this link : https://github.com/hisea/devise-bootstrap-views
When using a rails application template is possible to make so that some default gems (sqlite3, coffescript and sass) are not included in the Gemfile?
I'm sure you've solved this problem in the last 7 years, but for everyone else, the best method I've seen for doing this is to gsub it out of the file:
# Removes sqlite3, coffee-rails, and sass-rails gems
gsub_file "Gemfile", /^gem\s+["']sqlite3["'].*$/,''
gsub_file "Gemfile", /^gem\s+["']coffee-rails["'].*$/,''
gsub_file "Gemfile", /^gem\s+["']sass-rails["'].*$/,''
Yes, just modify your application template file to not include them.
take a look https://github.com/RailsApps/rails3-application-templates
to get a better idea, specifically mongoid templates
When using Warbler, what line(s) do I need to add to config/warble.rb to keep it from including Active Record in the bundled gems. I already have excluded Active Record in config/environment.rb as shown below.
config.frameworks -= [ :active_record ]
I tried the same thing only using config.gems in config/warble.rb, but to no avail.
I haven't been able to try either of these ideas, but looking at Nick Sieger's examples :-
Does the gem name have to be a String rather than a Symbol?
It looks like activerecord maybe being included implicitly because config.gems includes rails and config.gem_dependencies = true. Maybe you need to change config.gem_dependencies to false and explicitly include rails, actioncontroller, etc in config.gems.
It might be instructive to print out or log the value of config.gems from within the warble.rb file.