Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that...
Has no options to sort the loaded files in any way. RSpec 1 Runs .rb files in alphabetical order by default. This is a good default because it...
...matched until Capybara 2 which used to "squish" text prior to the comparison. # Capyabara 1 or 2 page.find('.haystack', text: "Hi! Try to match me.") => #<Capybara::Node::Element tag="div...
...suspect parallel execution for bundling issues, you can try serially with bundle install --jobs 1...
Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout server.key...
How generated form params look like If you have authors with the IDs 1, 2 and 3, the check boxes above will be named like this: Note the hidden...
In your Rails controller, this will create params like this: { 'post' => { 'author_ids' => ['1', '2', '3', ''] } } Permitting array params in your controller Note that you need some special syntax...
...suppress_multiple_term_dialog = True [keybindings] [profiles] [[default]] cursor_color = "#aaaaaa" font = Ubuntu Mono 14 use_system_font = False [layouts] [[PROJECT_NAME]] [[[child0]]] type = Window parent = "" position = 3458:171 maximised...
...profile = default command = 'env startup_cmd="foreman start" startup_args="-f Procfile.dev -m all=1,web=0" bash' [plugins] To make the environment variables work, put the following into your...
class User < ActiveRecord::Base ... end class SignUp < ActiveType::Record[User] ... end user = User.find(1) sign_up = ActiveType.cast(user, SignUp) sign_up.is_a?(SignUp) # => true This is basically like ActiveRecord#becomes...
...entire relation (scope) to a relation of an ActiveType::Record: adult_users = User.where('age >= 18') adult_sign_ups = ActiveType.cast(adult_users, SignUp) sign_up = adult_sign_ups.find(1) sign_up.is_a?(SignUp) # => true
cookies_jar = ActionDispatch::Cookies::CookieJar.build(request, cookies.to_hash) cookies_jar.signed[:user_id] = 1 cookes[:user_id] = cookies_jar[:user_id] get "/movies/#{user_id}/favorite" Example: describe '/movies...
...console with other request like from ActionCable. Then just set the max threads to 1 and the other requests have to wait. WORKER_TIMEOUT=1000 puma -t 0:1 -w...
...1 -p...
...super, initialize might be hit with this error: ArgumentError: Wrong number of arguments (given 1, expected 0) Further readings https://github.com/makandra/active_type#activetypeobject
...feeds, carriage returns, etc. There's a TC39 proposal that's stuck in Stage 1. While there is a /m modifier in Javascript, it only changes the meaning of ^ and...
...a selector. For example: .container .foo %span.my-selector .bar %div.my-selector .container > *:nth-child(1 of .my-selector) color: red Here, you specifically target the first element with the .my...
...grab the nth element of a certain type/tag. Browser Support https://caniuse.com/mdn-css_selectors_nth-last-child_of_syntax Chrome/Edge 111+ Firefox 113+ Safari 9+ Finding the last child matching a selector There is :nth-last...
...than it is to explain why your application does not need secure cookies. Option 1: ActionDispatch::SSL middleware You can use the ActionDispatch::SSL middleware to automatically set the secure...
subject { 'foo' } it_behaves_like 'string equaling another string', 'foo' end RSpec 1 Use it_should_act_like from our spec_candy.rb (note the /behave/act/). It allows you to...
``` def foo "hello!" end ``` def foo "hello!" end Lists * Bullet list item 1 * Bullet list item 2 Bullet list item 1 Bullet list item 2
...use + or - instead of *. 1. Numbered list item 2. Numbered list item 42. You don't need to number properly Numbered list item Numbered list item You don't need...
...def method_missing(method, *args, &block) if method.to_s =~ /play_(\w+)/ puts "Here's #{$1}" else super end end def respond_to?(method, *) method.to_s =~ /play_(\w+)/ || super end
...monitoring route which returns a json looking like this: { "sidekiq": { "totals": { "failed": 343938, "processed": 117649167 }, "recent_history": { "failed": { "2016-11-06": 1...
} }, "queue_sizes": { "dead": 0, "retries": 0, "monitoring": 0, "low_priority": 0, "mails": 0, "default": 0, "elasticsearch": 0, "high_priority": 0, "file_upload": 0, "scheduled": 0 }, "active_workers": 0 },
...Fetching strscan-3.0.3.gem Building native extensions. This could take a while... Successfully installed strscan-3.0.3 1 gem installed gem list strscan *** LOCAL GEMS *** strscan (3.0.3, default: 3.0.1) Therefore is may happen...
...local database, transfer it to a server and import it in the server database. 1. export def dump_to_file(list) content = Base64.encode64(Marshal.dump(list.to_a)) file_path = File.expand_path...
...links to work on Gnome/Linux. Here is how it finally worked for me: Step 1: Add a Desktop launcher Add this file to ~/.local/share/applications/rubymine.desktop: [Desktop Entry] Version=1.0 Type=Application...
...to affect the whole container text, not separate children. For example, .container %p Text 1 %p Text 2 %p Text 3 with .container display: -webkit-box would be shown as...
...row.insertBefore imageTemplate # Prepare the template to be cloned for the next image increaseTemplateIndices: -> # E.g. ("[1]", "1") -> "[2]" increase = (match, $1) -> match.replace $1, parseInt($1) + 1 imageTemplate.find('input').each -> $input = $(this...
# @return: The progress bar element addProgressBar: (element) -> progressBar = $(' ').addClass('image--progress').css 'width', '100%' progressBar.appendTo element.find('.image') # This progress bar *shrinks* from full width to the right updateProgressBar: (event...
...instance use only 20GB disk space but the disk file on the server has 100GB (or even more). To resize the disk file do the following: Check storage on the...
vm $ df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 99G 19G 75G 21% / udev 2.0G 12K 2.0G 1% /dev tmpfs 396M 236K 396M 1% /run...