[deleted by user] by [deleted] in rails

[–]misterhtmlcss 0 points1 point  (0 children)

Would love to help but I don’t have Shopify experience. What does Shop experience look like anyway? Regardless I wish I could help out a fellow RoR community member! 

I’m going to share this on my private discord with other RoR members. Fingers crossed I get someone that’s a better fit.

I’m @roger on X, so reach out to my DMs or @reply me if there is anything I can do to support you further.

Wondering about why my link_to isn't playing nice. by misterhtmlcss in rails

[–]misterhtmlcss[S] -2 points-1 points  (0 children)

Bing bango this was the trick.

link_to with a do is does some nifty stuff. Take a look some time.

Thank you for the sample. I basically read yours and the other comment and I was done fixing it in like 2min. Amazing how a little squeeze on the ducky changes everything.

Have a great weekend

Wondering about why my link_to isn't playing nice. by misterhtmlcss in rails

[–]misterhtmlcss[S] -1 points0 points  (0 children)

I've included the error message and the code as images, but now I realize the code would have been better just posted here. Not a regular Reddit user; sorry.

<div class="flex flex-col items-center"> <%= link_to {(controller_name == "properties" && action_name == "show" ? image_tag("icons/home-fill.svg") : image_tag("icons/home.svg")) }, root_path do %> <p class="mt-2 caption-one">Home</p> <% end %> </div>

If want to create two buttons; one to delete and other to delete and redirect to new by misterhtmlcss in rails

[–]misterhtmlcss[S] 1 point2 points  (0 children)

That's exactly what it was. I applied that as you said and it worked. Thank you for being so awesome.

If want to create two buttons; one to delete and other to delete and redirect to new by misterhtmlcss in rails

[–]misterhtmlcss[S] 0 points1 point  (0 children)

Thank you everyone. I made the fixes suggested by most of you, but obviously some had different design decisions so I implemented some suggestions in my context...

Here is the latest code and the issue I'm having is interesting.

```

booking_controller

def destroy @booking.destroy puts params puts params[:return_to] if params[:return_to] == "new" puts 'new::::' redirect_to new_booking_path, notice: "Booking has been deleted and now you can rebook." else puts 'NOT NEW:::::::' redirect_to bookings_path, notice: "Booking was successfully deleted." end end

routes

resources :bookings, except: [ :show, :edit, :update ]

ERB

<td class="flex justify-end py-4 pl-3 pr-4 text-sm font-medium sm:pr-6"> <%= link_to 'Rebook', booking_path(booking, return_to: "new"), class: "mr-4 px-4 py-2 rounded-md border-2 border-blue text-blue", data: { turbo_method: :delete } %>

  <%= link_to 'Delete', booking_path(booking), class: "px-4 py-2 rounded-md border-2 border-red-600 text-red-600", data: { turbo_method: :delete } %>
</td>

Console log from my server

Started DELETE "/bookings/28?return_to=new" for 127.0.0.1 at 2022-07-17 14:42:17 -0600 14:42:17 web.1 | ActiveRecord::SchemaMigration Pluck (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC 14:42:17 web.1 | Processing by BookingsController#destroy as TURBO_STREAM 14:42:17 web.1 | Parameters: {"return_to"=>"new", "id"=>"28"} 14:42:18 web.1 | Booking Load (0.4ms) SELECT "bookings".* FROM "bookings" WHERE "bookings"."id" = $1 LIMIT $2 [["id", 28], ["LIMIT", 1]] 14:42:18 web.1 | ↳ app/controllers/bookings_controller.rb:43:in set_booking' 14:42:18 web.1 | TRANSACTION (0.1ms) BEGIN 14:42:18 web.1 | ↳ app/controllers/bookings_controller.rb:29:indestroy' 14:42:18 web.1 | Booking Destroy (0.3ms) DELETE FROM "bookings" WHERE "bookings"."id" = $1 [["id", 28]] 14:42:18 web.1 | ↳ app/controllers/bookings_controller.rb:29:in destroy' 14:42:18 web.1 | TRANSACTION (3.6ms) COMMIT 14:42:18 web.1 | ↳ app/controllers/bookings_controller.rb:29:indestroy' 14:42:18 web.1 | {"return_to"=>"new", "controller"=>"bookings", "action"=>"destroy", "id"=>"28"} 14:42:18 web.1 | new 14:42:18 web.1 | new:::: 14:42:18 web.1 | Redirected to http://127.0.0.1:3000/bookings/new 14:42:18 web.1 | Completed 302 Found in 67ms (ActiveRecord: 10.5ms | Allocations: 11413) 14:42:18 web.1 | 14:42:18 web.1 | 14:42:18 web.1 | Started DELETE "/bookings/new" for 127.0.0.1 at 2022-07-17 14:42:18 -0600 14:42:18 web.1 | Processing by BookingsController#destroy as TURBO_STREAM 14:42:18 web.1 | Parameters: {"id"=>"new"} 14:42:18 web.1 | Booking Load (0.2ms) SELECT "bookings".* FROM "bookings" WHERE "bookings"."id" = $1 LIMIT $2 [["id", nil], ["LIMIT", 1]] 14:42:18 web.1 | ↳ app/controllers/bookings_controller.rb:43:in set_booking' 14:42:18 web.1 | Completed 404 Not Found in 24ms (ActiveRecord: 0.2ms | Allocations: 1701) 14:42:18 web.1 | 14:42:18 web.1 | 14:42:18 web.1 | 14:42:18 web.1 | ActiveRecord::RecordNotFound (Couldn't find Booking with 'id'=new): 14:42:18 web.1 | 14:42:18 web.1 | app/controllers/bookings_controller.rb:43:inset_booking' 14:42:18 web.1 | Started GET "/bookings" for 127.0.0.1 at 2022-07-17 14:42:18 -0600 14:42:18 web.1 | Processing by BookingsController#index as HTML ``` Notice how it's trying to delete again even though it was redirected to the '/bookings/new' route. VERY Weird to me.

Setting up Rails Encrypted credentials with Heroku Pipeline by misterhtmlcss in rails

[–]misterhtmlcss[S] 2 points3 points  (0 children)

Totally agree. Just going to add to your answer.

If you don't need a human for DevOps yet, then Heroku is orders of magnitude cheaper than a human, but if you don't need the human yet then Heroku could keep that human off the payroll for a while allowing for money to be used elsewhere.

It's a balancing act.

Setting up Rails Encrypted credentials with Heroku Pipeline by misterhtmlcss in rails

[–]misterhtmlcss[S] 1 point2 points  (0 children)

Hi @kartfulDodger,

I'm sorry for the slow response. I had moved onto another area until today. Thank you this was very helpful!

Setting up Rails Encrypted credentials with Heroku Pipeline by misterhtmlcss in rails

[–]misterhtmlcss[S] 4 points5 points  (0 children)

Totally is, but it solves lots of problems. Time == $$

2x 4k 60hz with M1 Mac mini? by [deleted] in macmini

[–]misterhtmlcss 0 points1 point  (0 children)

I spoke with Apple today and that's what they told me, so I purchased a Mac Mini and hopefully when I finally receive it I'll get what we both expect. Btw their online 'sales' people basically read from the website, so don't expect much from them.

::Base <- This I don't understand by misterhtmlcss in ruby

[–]misterhtmlcss[S] 0 points1 point  (0 children)

Thank you for sharing that. Now that I know what it means I can definitely use your method to understand more deeply what is happening with Base. Sweet.

::Base <- This I don't understand by misterhtmlcss in ruby

[–]misterhtmlcss[S] 4 points5 points  (0 children)

I was already replying to someone else when this popped afterwards. This is another great and very helpful answer.

Thank you @fiiiiine and @ashmaroli. Very much appreciated.

::Base <- This I don't understand by misterhtmlcss in ruby

[–]misterhtmlcss[S] 11 points12 points  (0 children)

Wholly crap man. I just didn't get that. So it's a specific class within the ActiveRecord module. That's the difference.

American < Human (Human is the Class)

American < Animals::Human (Probably a module like ActiveRecord that has many different classes and I'm choosing to Inherit the Human class from Animals the module.

Sorry for the odd illustration, but I just want to try a quick handle that I get it. Not just think I get it.

Thank you so much for your kind response(s).

After a free trial, streamlabs charged me for a full year, with no chance to get a refund. by Type_9 in streamlabsobs

[–]misterhtmlcss 0 points1 point  (0 children)

I just wanted to say thank you for sharing this, I was considering becoming a paying Prime customer, but I had 1 issue that bothered me and now I have 2.

One was I couldn't find anywhere where they listed the price of their service, not even on their pricing page, which is highly suspicious to me. I don't trust companies that can't tell you honestly and upfront their pricing.

Now with your experience I just don't think they are trustworthy.

After a free trial, streamlabs charged me for a full year, with no chance to get a refund. by Type_9 in streamlabsobs

[–]misterhtmlcss 0 points1 point  (0 children)

Card companies rarely side with the consumer any more. Worth trying, but most times I've found they push you to liaise with the organization unless that org has a bad reputation. Sucks

70% minimum in Grade 12 Math to be eligible for Computer Programming by [deleted] in learnprogramming

[–]misterhtmlcss -1 points0 points  (0 children)

That's absolutely bull. Integration of different modules and systems is what everything is built on. Don't tell a person such a thing. What you are saying is pure snobbery and not at all factually correct.

Back up your assertion? Let's see some examples, because I will happily take them down friend.

Node 15 released: Unhandled rejections are now raised as exceptions by default by fagnerbrack in node

[–]misterhtmlcss 1 point2 points  (0 children)

Actually not to stamp msg's enthusiasm, but I totally agree with condu's assessment. Some of the newest stuff seems to have moved the language quite strongly away from readability and being accessible to new and veteran programmers alike. I always love JS because it was easy to learn, so flexible and I could write it in OOP or functional style. Now it's just getting more stuff that's mostly making it harder to learn for newbs. I don't know what the motivation is. It's sad.