Nick McNeany

Joined

9,120 Experience
71 Lessons Completed
1 Question Solved

Activity

Posted in Realtime Notifications with ActionCable Discussion

Thanks, Chris! This is an awesome episode, you're the man!

This was awesome! Thanks Chris!

Posted in Display user

Thanks Chris and Isaac, I appreciate your help!

Chris, the resource you pointed me to fixed my drop down problem. The problem that I'm having now is, when I select a user the img tags and url to the photo shows up in the input box.

I tried just splitting up my string and selecting the first part of the entry in the form, but no luck.

jQuery ->
  $('#username').autocomplete(
    source: $('#username').data('users-source')
   ///Here, not sure if I'm even doing this right
    select: (event, ui) ->
        $('#username').on 'autocompleteselect', (event, ui) ->
           $('#username').val ui.item.value.split(' ')[0]
      return
  ).data('uiAutocomplete')._renderItem = (ul, item) ->
    $('<li />').data('item.autocomplete', item).append(item.value).appendTo ul

this is my JSON

["Nickiam7 \u003cimg src=\"https://lisst-dev.s3.amazonaws.com/uploads/user/user_photo/1/thumb_stay_puft.jpg\" alt=\"Thumb stay puft\" /\u003e","jsmith \u003cimg src=\"\" /\u003e","the Turd \u003cimg src=\"https://lisst-dev.s3.amazonaws.com/uploads/user/user_photo/2/thumb_new_me.jpg\" alt=\"Thumb new me\" /\u003e"]

I also tried using jQuery in the actual view to target the form and remove everything after the first part of the value, but I couldn't get that to work either!

Isaac, I'm hoping someone might be able to help me out with this before I try your solution. I appreciate your help!

Thanks again to anyone who can help me!

Posted in Display user

Hi Everyone,

I'm trying to display a users profile image, along with their username in an autocomplete dropdown.

The autocomplete functionality works fine, I'm just having trouble displaying the actual image in the dropdown. I get the image URL instead of the image.

I'm using carrierwave for image uploading and jQuery-UI for autocomplete.

users_controller.rb

def index
  @users = User.order(:username).where("username like ?", "%#{params[:term]}%")
  render json: @users.map{ |user| "#{user.username} - #{user.user_photo}"}
end

In my index action, for some reason "#{user.user_photo}" provides the link to the image, not the actual image.
I've also tried view_context.image_tag("#{user.user_photo.url}"), but that returns the actual HTML img tags and all.

The form:

<% if policy(@list).add_collaborators? %>
  <h3>Add Collaborator</h3>
  <%= form_for [@list, @collaboration] do |f| %>
    <%= label_tag "Enter collaborator username" %>
    <%= text_field_tag :username, nil, data: {users_source: users_path} %>
    <%= f.submit "Add collaborator" %>
  <% end %>
<% end %>

autocomplete.js.coffee:

jQuery ->
  $('#username').autocomplete
    source: $('#username').data('users-source')

This is what I get. I want the image, not the URL to the image.

I have this posted on stackoverflow as well, but I'm not getting much traction there so I wanted to post it here too.

Thanks for any help!

Awesome! Would love more episodes about Mailboxer, if you think there's still more worth covering!

Thanks Chris!

Posted in Front-end frameworks and Turbolinks

Thanks Isaac!

I'll look into lightbox navigation.

Posted in GoRails Markdown and Preview

I agree with Enrique. I've used RedCarpet as well, works great.

Posted in Front-end frameworks and Turbolinks

Hey Everyone,

I'm having a small problem with the JavaScript components of the Uikit framework and I know it has to do with turbolinks. Here's the gem I'm using Uikit2-Rails.

I followed Chris's upgrading to turbolinks5 episode, but I still can't get them to work after the initial page load, I'm also using jquery-turbolinks.

Does anyone know of a work around for turbolinks and front-end frameworks, or should I just ditch turbolinks?

Thanks for any help!

Posted in How to Upgrade to Turbolinks 5 Discussion

Oh man! In an effort to avoid any spelling errors I copied and pasted the file name from the repo. The only problem is I copied an extra space at the end of the name so the file names didn't match up and I couldn't see it until I highlighted the file name! DOH!

Thanks for your help Chris! You're the man!

Posted in How to Upgrade to Turbolinks 5 Discussion

Wow, thanks for the quick response!

I do have the compatibility file in my app/assets/javascripts directory and I'm requiring it my application.js file after the turbolinks require.

Do you think something has changed from beta1 one to beta2 that's causing the problem?

Posted in How to Upgrade to Turbolinks 5 Discussion

Thanks for the great video Chris!

I keep getting an error though:

"couldn't find file 'compatibility' with type 'application/javascript'"

I think some things have changed since your video, like the compatibility file name, but other than that, I followed your video exactly.

The error is being raised in my application.html.erb. Also, I'm using turbolinks-source 5.0.0.beta2

Any thoughts?

Thanks,

Nick

Posted in In-App Messages Between Users Discussion

Great episode Chris!

Can't wait to get into the more advanced stuff.

Thanks!

Posted in In-App Navbar Notifications Discussion

You're the man Chris, great video!!!

Yes, I would love to see some videos about React, and I would love it even more if you packaged this into a gem!!!

Thanks again for all your great videos!

Posted in Use a gem I created, that needs to remain private?

Awesome!

I was leaning towards option one as well.

Thanks Chris!

Posted in How would i go with making an inventory for products?

I assume you'll be using Rails, so you might want to check out SpreeCommerce. I haven't used it myself yet, but it looks very promising.

If you YouTube SpreeCommerce, some pretty detailed videos should come up.

Posted in Use a gem I created, that needs to remain private?

Hey Chris,

First, thanks for all the great videos and for taking the time to answer all these questions!

I want to make a gem for a front-end, Bootstrap spin-off, framework. I've watched your creating a gem video, so my question isn't so much about creating the gem but how to use it afterwords.

I've purchased a copy of the framework and have the proper licensing to use it in my application. So, my question is how do I use it? I don't want to release it to ruby gems or github, as it would be made public (if it were up to me I couldn't care less about releasing something I purchased to the public, but I want to honor their licensing agreements), but I'm not sure how else to get it into my app any other way. Can I use it directly from my machine, like you did in your video, in production?

Thanks for your help, Looking forward to hearing your advice!

I would definitely be interested in seeing a screen cast on this as well!

Chris, this is awesome!

I was hoping you'd do a Searchkick/ElasticSearch video since you did the Ransack video!

Thanks for all the great videos!

Posted in What Is A State Machine? Discussion

Hey Chris,

I believe it's pronounced "Pop", not soda... :D

Thanks for the great videos!

Posted in Forum Series Part 6: Search with Ransack Discussion

Awesome! Thanks, Chris.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.