TG

Joined

220 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in simple mde duplicates

i have removed thr ready but still the turbolinks duplicates the teaxtarea when i go forward and backward

var simplemde;

simplemde = null;

$(document).on('turbolinks:before-visit', function() {
  if (simplemde != null) {
    simplemde.toTextArea();
    return simplemde = null;
  }
});

$(document).on('turbolinks:load', function() {
  return simplemde = new SimpleMDE({
    element: $("#textarea2")[0],
    showIcons: ["code", "table"]
  });
});

Posted in simple mde duplicates

hi,
i followed your tutorial but still simple mde is been diplicated
am using rails 5

var simplemde;

simplemde = null;

$(document).on('ready turbolinks:before-visit', function() {
  if (simplemde != null) {
    simplemde.toTextArea();
    return simplemde = null;
  }
});

$(document).on('ready turbolinks:load', function() {
  return simplemde = new SimpleMDE({
    element: $("#textarea2")[0],
    showIcons: ["code", "table"]
  });
});

Posted in why .limit not working with find_by

Category.where would fail so am able to fix it with
also using find_by since am looking for only one record

@categories = Category.find_by(slug: params[:slug])
@category = @categories.products.paginate(:page => params[:page], :per_page => 20).order('created_at DESC')

Posted in why .limit not working with find_by

am trying to retrieve date with @category = Category.find_by(slug: params[:slug]).limit(5) but i get undefine method .limit

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

© 2021 GoRails, LLC. All rights reserved.