This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_with(model: post) do |form| %> | |
<% error_handler = ::InlineErrorHandler.new(post, self) %> # Initialize the error handler presenter here, or consider doing this in the controller | |
<div> | |
<%= form.label :title, style: "display: block" %> | |
<%= form.text_field :title %> | |
<%= error_handler.error_message_for(:title) %> # Display inline error for the title field here | |
</div> | |
<div> | |
<%= form.label :body, style: "display: block" %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"action": "created", | |
"installation": { | |
"id": 42355905, | |
"account": { | |
"login": "justinvoicit", | |
"id": 86925994, | |
"node_id": "MDEyOk9yZ2FuaXphdGlvbjg2OTI1OTk0", | |
"avatar_url": "https://avatars.githubusercontent.com/u/86925994?v=4", | |
"gravatar_id": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account with 2-step Verification | |
If your Gmail account uses 2-step verification, you will need to get an app password and use that instead of your regular password. If you don't use 2-step verification, I recommend turning it on to avoid getting the emails blocked by Google. | |
To create an app password, go to your Google account settings and navigate to the "Security" tab. Under "Signing in to Google", click on the "App passwords" menu item (this will only be available if you have 2-step verification turned on). Next, select Other (Custom name) under the "Select app" dropdown and enter the name of your app or something else useful. Click "Generate" and your new app password will appear on the screen. Make sure you copy it before closing the window, or you won't be able to see the password again. | |
Now, in your Rails app mailer settings, replace the <gmail_password> with the new app password instead. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_with(model: post) do |form| %> | |
<% error_handler = ::InlineErrorHandler.new(post, self) %> | |
<div> | |
<%= form.label :title, style: "display: block" %> | |
<%= form.text_field :title %> | |
<%= error_handler.error_message_for(:title) %> | |
</div> | |
<div> | |
<%= form.label :body, style: "display: block" %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="btn-toolbar mb-2" role="toolbar" aria-label="Toolbar with button groups"> | |
<div class="col-md-10"> | |
<div class="form-floating"> | |
<input type="email" class="form-control" id="floatingInput" placeholder="[email protected]"> | |
<label for="floatingInput">Search Customer</label> | |
</div> | |
</div> | |
<div class="col-md-2 text-center"> | |
<div class="btn-group mt-1" role="group" aria-label="First group"> | |
<button class="btn btn-light btn-lg btn-outline-primary" type="button"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Procfile which is required by heroku. | |
web: bin/rails server -p $PORT | |
worker: bundle exec sidekiq -c 2 -e staging | |
# REDIS | |
# REDISTOGO_URL for local is bydefault: redis://0.0.0.0:6379/0 | |
# REDISTOGO_URL for heroku | |
# Use Redistogo heroku addon | |
# Addon will provide REDISTOGO_URL which should be added in the heroku config. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To match only few attributes of an object | |
# have_attributes | |
expect(person).to have_attributes(:name => "Jim", :age => 32) | |
# To match attributes of a collection | |
expect(notes) | |
.to match_array([ | |
have_attributes( | |
notable_id: talent.id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag(submit_path, remote: true, method: :get, id: 'add_line_item') do %> | |
<div class="col"> | |
<div class="form-row"> | |
<div class="col-md-10"> | |
<%= grouped_collection_select(:line_item, :product_id, current_user.categories, :products, :name, :id, :name, { prompt: '--Select Product--' }, { class: 'form-control form-control-sm' }) %> | |
</div> | |
<div class="col text-center"> | |
<%= submit_tag 'Add', class: 'btn btn-outline-secondary btn-sm'%> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect(response.parsed_body['data']).to(include( | |
'active' => true, | |
'name' => 'some group', | |
'once_per_user' => true | |
)) |
NewerOlder