Coder Social home page Coder Social logo

esl_app's People

Contributors

andrewfritz86 avatar

Watchers

 avatar

esl_app's Issues

When deployed, I am getting an error that blocks my api calls due to the api URL not being secure

Hi all, here is the message I get in the JS console when trying to make an API request. This works fine in development.

[blocked] The page at 'https://safe-cove-5673.herokuapp.com/story_form' was loaded over HTTPS, but ran insecure content from 'http://api.wordnik.com/v4/word.json/different/definitions?limit=200&include…ncludeTags=false&api_key=64e90a58d89a8e7f3f000001fe809d0cd55d32cb45b9f117e': this content should also be loaded over HTTPS.

Adding an 's' to the URL doesn't seem to help.

General questions about scripts in Rails and where to put them.

Hey guys, running into the same issue I had last night, trying to render views and the underscore template is coming back undefined because my scripts aren't loading in order.

I tried moving my scripts for rendering views and creating models directly onto the page which contains their templates. The problem is that the scripts won't load because jquery hasn't loaded yet (the javascript_include_tag is now in the footer of application.html.css.

I then moved the JS include tags back to the header, but still no luck. Any thoughts?

Getting errors when trying to create views for a resource

Hi all.

My app has a resource called a 'citation', basically a snippet of text that is appended to a longer paragraph in my app that builds a story.

I have three JS files going, main, citation_view, and citation. I am able to persist citations to the db, so the model for citations seems to be working.

However, I am getting an undefined function error when I try and init my citationView objects. The object is created (I can see that with debugger), but when I try and call init on it, I can't go any further.

Below is the code for citation_view js in my app

console.log("citation views linked!")

function CitationView(model){
  this.$el = $("<p>");
  this.model = model;
  this.id = model.id;
  debugger
}


CitationView.prototype = {

  template: _.template($("#citation-template").html()),

  render: function(){
    var template = this.template({citation: this.model});
    this.$el = $(template);
    return this;
  },

  init: function(){
    var view = this;
    // view.render();
    toAppend = $("<p>");
    toAppend.html(this.model.body)
    $(".story").append(toAppend);
    return this;
  }
}

I've been staring at this for hours and just can't find a way around. The error stems from my createCitation function in mainJS, which looks like this.

eslApp.createCitation = function(data){
  var citation = new Citation(data);
  var citationView = new CitationView(citation)
  // debugger
  citationView = citationView.init();
  //eslApp.pushView(citationView)
  return citation;
}

If I comment out the line below the debugger, the line calling init on CitationView, the object persists to the db just fine. Any and all help would be great. I'm really stuck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.