eelcoj

Joined

8,350 Experience
0 Lessons Completed
10 Questions Solved

Activity

I've been running into issue when using hyphens in the controller or target name and not 100% sure about the issue or fix—could try camelCase or try to you a controller name without hyphens.
You called your action `toggle`, but it's not actually one of the short-hand actions in [Stimulus](https://stimulusjs.org/handbook/building-something-real#common-events-have-a-shorthand-action-notation). 

You can try this, which should work I think:

toggle() {
    this.contentTarget.classList.toggle("hidden")
    this.formTarget.classList.toggle("hidden")    
  }
It will look for the hidden class, if found, "remove" it and otherwise "add" it.
I currently interact with Stripe using small, one-off Service objects. Can be run using any background worker. 
I also set an `idempotency_key`, with simply `SecureRandom.uuid`
Since most of it is done using Javascript, you could technically copy the code from any example you have. 
As for the Rails part, you likely need to get `get` the Json for the user. Also CORS is something to keep in mind. 
I've build a couple of JS snippets/embeds. Happy to help with any specific issues.
Did you try duplicating all the keys below `en:` for your Spanish translation? I'd expect you can use the same file.

I see you can you pass in the format as a :symbol (`
<%= local_time(date, :long) %>
`), this should look for it in the `config/locale/xx.yml` files.
Doesn't it use the i18n yml in `config/locale/<xx>.yml`? 
Great base/starting point is https://github.com/svenfuchs/rails-i18n

Posted in ibm Iseries AS/400 DB2

What is "without success"? What did you try? Which errors do you see? And more info? OS? Rails/ruby version?

Posted in User create Dynamic Role base

I recently did this using Rolify. _Fairly_ straightforward. 

Posted in How do I add a /user.json file using devise?

You can create your own UsersController and have the index action render json. Don’t think there’s anything more (or rails magic to it) to it. 
FormObjects would be the way to go not save to your DB. Chris did a screencast for just this use case: https://gorails.com/episodes/form-objects-design-pattern

As for the image url: depends. Too little info to give a complete answer, but likely it's not a public url. See into the gem you use for file uploading for a "make public url" option.
What is in the `@ad` variable you refer to in your show action?
Are you running SSL on your development machine? Ot are you running your server in development? Bit confused by this.

Possible cause is you're redirecting to `https://…` for development. You can, for testing purposes, set your app's redirect url to `http://`—if you did not set up SSL (unlikely). Or it's the other way around—your redirect url is not properly set up (including `https://`).

There are plenty of other possible—but not enough info (for me at this point), to help more.

Posted in rendering issue

What did you set `@status_update` to in your controller's action?

Posted in Ruby on Rails migrations into a single migration?

Afaik, there's no automated way of doing this. And when I do—that is before I push to a shared repo—, I do it manually. 

Also, what's up with the link? Is this a new kind of smart spam bot? 
It's not possible to add html element (like a `<i />`) inside of an `<input />` field. You could add/move it before the input field, so it looks visually more to what you are aiming for.
Not sure why wouldn't be able to loop over the images when on the index action. You should be able to loop over your PropertyPhotos there too (eg. `<%= @property.property_photos.each … %>`). 
If you give us some code you currently have, it's easier to give some more specific solution/options.
I am afraid something else is broken than, I see a pretty blank page on both Safari and Chrome.
Looks like you fixed the issue?

Posted in What is the best way to house view logic?

Helper method with a case/switch statement would work well here.

somethng along the lines of

case step
when "step1"
  "…"
when "step2"
  "…"
when "step3"
  "…"

You are scoping comments to the User, but not to the blog. So you need to add the blog_id too in the create action.
You can see in your log that the blog_id is empty too.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.