nynhex

Joined

940 Experience
1 Lesson Completed
1 Question Solved

Activity

Figured this out, see SO for the details. It was an HTML issue. Resolved :)

I've been struggling with this all day. Please see the link below.

Bootstrap 4 modal form in rails disables submit button on ajax refresh

I've tried removing turbolinks, attempting to user jquery-turbolinks but there's no compatibility, and writing JS to try to fix this but to no avail.

Summary:

Modal is fired when you click on "notes" for a call object. Modal pops up and you enter a note and it does a regular html submit and posts the note, refreshing the page. An ajax request refreshes the partials every 15s, after the refresh happens if you hit "notes" again it will pop up, you can enter text, but the submit/create button does nothing when you click it.

No errors in the js console and nothing in the development.log. It only starts working again when you do a page reload.

I had similar functionality in an older Rails 3.2 and 4.2 app with bootstrap 2.x and 3.x and had no problems. But moving to Rails 5.1, Bootstrap alpha 4 v6 gives me no joy.

My first born cat to the talented person who can help me debug this :)

I'm building a simple wiki app and would like to introduce autocomplete search using Searchkick or pg_search. In the search box I'd like to be able to do a search across both an Article and Category model searching Article for title and body and Category by the name column.

I think I can do this with pg_search using multisearch, but I'm curious as to how to display this information using JSON in the search box and how it works similar to Gorails.

Looking foward to an episode on this :)

Posted in Using React

I ran into a similar problem with an old client. They wanted a React frontend with a Rails backend and the routing mixed with React-Router was a nightmare. So I rewrote the backend to be 100% API driven and the frontend is served up and is 100% react which makes HTTP requests to the API backend.

If you need any help with this, feel free to reach out in Slack

Posted in What is your dream app?

Actually my dream app and something I'm working on right now is a web based penetration testing framework using Ruby/Rails. It's a pet project that should yield some interested traction. The only problem (not really a problem of difficulty but of time) is that of porting all known attack vectors to Ruby and being able to use them properly.

I'm basically rewriting metasploit in Ruby/Rails. Meh

Posted in What is your dream app?

My dream app is one that writes code for me so I can sit back and drink coffee and read reddit.

You're going to want to store the action details somehow in a method as Jacob mentioned called track_user or whatever naming convention you deem fit. You'll probably have to write the method that such it will track changes or actions and log the to some sort of table.

If you want to track model changes agnostic of the controller I'd suggest audited public_activity or the ever popular paper_trail all of these are pretty good for auditing purposes. But if you just want to track when a user triggers an action in the controller then a custom private method as Jacob spelled out is best, you'll just have to customize it for each action/use case and it could get big. So I'd suggest breaking it up to smaller methods if you have many actions to track