Ruby & Rails – Ruby and Rails Blog https://rubyandrails.net This is where diamonds exists Wed, 18 Aug 2021 02:01:44 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 195321763 How To Create Nested Resources for a Ruby on Rails Web App | DigitalOcean https://rubyandrails.net/how-to-create-nested-resources-for-a-ruby-on-rails-web-app-digitalocean/ Wed, 18 Aug 2021 02:01:44 +0000 https://rubyandrails.net/?p=1127

Rails is a web application framework written in Ruby that offers developers an opinionated approach to application development. As you add complexity to your Rails applications, you will likely work with multiple models, which represent your applicati

Source: How To Create Nested Resources for a Ruby on Rails Web App | DigitalOcean

]]>
1127
Action View Form Helpers — Ruby on Rails Guides https://rubyandrails.net/action-view-form-helpers-ruby-on-rails-guides/ Sun, 15 Aug 2021 02:47:19 +0000 https://rubyandrails.net/?p=1119

Action View Form HelpersForms in web applications are an essential interface for user input. However, form markup can quickly become tedious to write and maintain because of the need to handle form control naming and its numerous attributes. Rails does away with this complexity by providing view helpers for generating form markup. However, since these helpers have different use cases, developers need to know the differences between the helper methods before putting them to use.After reading this guide, you will know: How to create search forms and similar kind of generic forms not representing any specific model in your application. How to make model-centric forms for creating and editing specific database records. How to generate select boxes from multiple types of data. What date and time helpers Rails provides. What makes a file upload form different. How to post forms to external resources and specify setting an authenticity_token. How to build complex forms.

Source: Action View Form Helpers — Ruby on Rails Guides

]]>
1119
button_to (ActionView::Helpers::UrlHelper) – APIdock https://rubyandrails.net/button_to-actionviewhelpersurlhelper-apidock/ Wed, 11 Aug 2021 18:11:01 +0000 https://rubyandrails.net/?p=1116 “# # “ Source: button_to (ActionView::Helpers::UrlHelper) – APIdock]]>

# => “# # “

Source: button_to (ActionView::Helpers::UrlHelper) – APIdock

]]>
1116
How to Count With ActiveRecord | Steve Grossi at Work https://rubyandrails.net/how-to-count-with-activerecord-steve-grossi-at-work/ Thu, 05 Aug 2021 18:17:54 +0000 https://rubyandrails.net/?p=1109

Posts

Source: How to Count With ActiveRecord | Steve Grossi at Work

]]>
1109
Validating, normalizing, and formatting phone numbers in Rails https://rubyandrails.net/validating-normalizing-and-formatting-phone-numbers-in-rails/ Thu, 05 Aug 2021 17:45:23 +0000 https://rubyandrails.net/?p=1105 Source: Validating, normalizing, and formatting phone numbers in Rails

]]>
1105
How to change the column type with Rails migrate https://rubyandrails.net/how-to-change-the-column-type-with-rails-migrate/ Thu, 05 Aug 2021 15:54:52 +0000 https://rubyandrails.net/?p=1100

change_column :customers, :phone, :string

Source: How to change the column type with Rails migrate

]]>
1100
Samples of pagination styling for will_paginate https://rubyandrails.net/samples-of-pagination-styling-for-will_paginate/ Thu, 05 Aug 2021 09:59:50 +0000 https://rubyandrails.net/?p=1098 Source: Samples of pagination styling for will_paginate

]]>
1098
node.js – ReferenceError: webpack is not defined – Stack Overflow https://rubyandrails.net/node-js-referenceerror-webpack-is-not-defined-stack-overflow/ Thu, 05 Aug 2021 04:01:43 +0000 https://rubyandrails.net/?p=1093

In my webpack app I have a basic build process that’s triggered by “npm run build” which executes the webpack binary and copies my index.html in /app to /dist. Whenever I run npm run build I get

Source: node.js – ReferenceError: webpack is not defined – Stack Overflow

]]>
1093
bootstrap5 ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41 https://rubyandrails.net/bootstrap5-error-in-node_modules-bootstrap-dist-js-bootstrap-esm-js-60-41/ Thu, 05 Aug 2021 04:01:05 +0000 https://rubyandrails.net/?p=1091

ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41Module not found: Error: Can’t resolve ‘@popperjs/core’ in ‘C:\laragon\www\tasky\node_modules\bootstrap\dist\js’webpack compiled with 1 errornpm ERR! code ELIFECYCLEnpm ERR! errno

Source: bootstrap5 ERROR in ./node_modules/bootstrap/dist/js/bootstrap.esm.js 6:0-41

]]>
1091
How to use Bootstrap with Webpack & Rails (Example) | GoRails https://rubyandrails.net/how-to-use-bootstrap-with-webpack-rails-example-gorails-2/ Mon, 02 Aug 2021 16:32:31 +0000 https://rubyandrails.net/?p=1063

Actually, I was even dumber than that. I installed Bootstrap 4.6.0 in my project, but I copied text from the docs for Bootstrap 5.

Source: How to use Bootstrap with Webpack & Rails (Example) | GoRails

]]>
1063