I have commented out gem 'simple_form' from my Gemfile with Rails Rails 3.2.12 and Ruby 2.0.0p0. When I do rails generate scaffold, I still get simple_form forms.
Is there a way to get the original form_for scaffolds instead?
The following should remove it properly:
# rails destroy simple_form:install
# bundle
Also, you can check for files in lib/templates and remove the associated ones for simple_form.
http://railscasts.com/episodes/234-simple-form?view=comments#comment_150699
http://github.com/plataformatec/simple_form/issues/680
try after installing bundle again,
bundle install
Related
I'm following some tutorials of association in rails database, the first step is to create the app with rails new newProject -B. Then i create the two models with rails g scaffold Father name:string and rails g scaffold Child name:string sex:string father:references.
After that i try to create the database with the command rake db:create, but an error appears:
Could not find nokogiri-1.6.7.1 in any of the sources Run bundle
install to install missing gems.
I run the command bundle install normally, but when i tried again, the same error appears.
I tried to insert in the GemFile gem 'nokogiri', '~> 1.6', '>= 1.6.7.1' and the same error persists.
I had a similar issue with nokogiri a couple of months ago.
I solved it by adding '-rc3' to the end of the gem version, like this:
gem "nokogiri", ">= 1.6.7.rc3"
I've had this problem a few times before, you can try installing the gem manually using gem install nokigiri
Have you try
$bundle update
?
Can you post the error logs to see if it is a Permissions Error or something else?
I am using active admin as given in Active admin install with Rails 4 . gem 'activeadmin', github: 'activeadmin' is installing.
But still i am getting error after running rails generate active_admin:install.
The error is
DEPRECATION WARNING: Support for Rails < 4.0.4 will be dropped from Formtastic 4.0. invoke devise
To use devise you need to specify it in your Gemfile. If you don't want to use devise, run the generator with --skip-users.
It means you did not install devise.
You want to
a) install devise: gem install devise, and then run rails generate active_admin:install. This will create default AdminUser object.
b) use the hint from warning, and install activeadmin with rails generate active_admin:install --skip-users.
Rails: 3.2.6
twitter-bootstrap-rails (2.2.3, 2.1.0)
I did the following:
rails generate bootstrap:install static -s
I then generated the scaffolding for certification as follows:
rails generate scaffold certification id:integer user_id:integer name:string description:string location:string status:string --skip-stylesheets -s
Then I tried to generate the twitter bootstrap views as follows:
rails generate bootstrap:themed certifications -f -s
Which gave me the following error:
undefined method `fields' for #<Class:0x007fe5e7282060>
and no changes were made to the certifications views. Any ideas?
I had similar issues, because I was working with a mix of mongoid and active records. I guess somehow there were conflicts while using the generator and it couldn't find the fields method anymore.
The solution for me was a reinstall twitter-bootstrap-rails gem with the following:
gem "twitter-bootstrap-rails", :git => 'https://github.com/seyhunak/twitter-bootstrap-rails.git'
Also, do not forget to run
rake db:migrate
after your
rails generate scaffold ...
For those working with mongoid, additional tip: everytime I have to generate a scaffold for an active record, I comment:
#gem "mongoid", "~> 3.0"
#gem "composite_primary_keys"
Then, generate, then uncomment
How do I remove the twitter-bootstrap-rails gem and all the assets and configurations from my rails app?
I installed it with
bundle install
#and
rails g bootstrap:install
Could you just do this :
rails destroy bootstrap:install
and remove it from your Gemfile?
How do I use the twitter-bootstrap-rails gem in my Rails 3.2.1 app? What is the workflow?
After I do:
rails g bootstrap:layout [LAYOUT_NAME] [*fixed or fluid] [options]
what do I do next? Do I just copy and paste the generated code into my view? Do I do this for every view? If so, how is doing
rails g bootstrap:themed [RESOURCE_NAME] [LAYOUT] [options]
any different?
Do you guys even use the rails generators?
Thanks
I'm the author of twitter-bootstrap-rails gem. I'll give you a quick walktrough to how to install and use twitter-bootstrap-rails.
Ruby stack;
(Ruby 1.9.3, Rails 3.1 or Rails 3.2 is required. Use RVM to get started)
After bundling gem to Gemfile by;
gem 'twitter-bootstrap-rails'
bundle install
Run install generator
rails g bootstrap:install
(it will includes Twitter Bootstrap to your app's asset pipeline)
Run layout generator
rails g bootstrap:layout application fixed
(it will generates layout for you, by default application.html.erb and fixed layout will generates)
Run themed generator (optional);
rails g scaffold post title:string description:text
(this step uses Rails generators to create CRUD stuff for you)
rake db:migrate
(migrating to database)
rails g bootstrap:themed posts
(Twitter Bootstrap compatible styling for your 'posts' views and form)
Also there is detailed documentation to install, usage and generators, coffeescript etc.
https://github.com/seyhunak/twitter-bootstrap-rails.
There is a RailsCasts tutorial that is a great starting point:
http://railscasts.com/episodes/328-twitter-bootstrap-basics
Run:
rails new APPLICATION -m anyfile.rb
anyfile.rb
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
generate("scaffold", "Post title:string content:text")
rake("db:create")
rake("db:migrate")
generate("bootstrap:layout", "application fluid")
generate("bootstrap:install")
generate("bootstrap:themed", "posts")
git :init
git :add => "."
git :commit => "-m First commit!"