ruby-on-rails,twitter-bootstrap,angularjs,lightboxRelated issues-Collection of common programming errors


  • Trip
    ruby-on-rails json tin-can-api articulate-storyline
    And as a result, Rails is dying short before my controllers and returning :781: unexpected token at ‘stateId=resume&registration=bar&actor=null&Authorization=foo&activityId=JumrnmV_course_id&Content-Type=application/json’This is a bit cryptic for me because I have no access to the 3rd party service. I can only append parameters to a query url and those get appended on the return payload.. which I think is corrupting my JSON..The launch query is this :’/system/’ + @myobj.id.to

  • Rajeev Thakur
    ruby-on-rails
    I have two model user and biography, both has one-to-one association and i want to user to add only one biography..here is the model:-class Biography < ActiveRecord::Baseattr_accessible :biography, :date, :title, :individual_id belongs_to :userendclass User < ActiveRecord::Basehas_one :biographyendHow can i validate user so that he can add only one biography. please help!

  • James Parker
    ruby-on-rails ruby haml erb
    I’m currently trying to convert an ERB layout to HAML. This is the error I keep receiving: index.html.haml:18: syntax error, unexpected ‘)’ ));}\n #{_hamlout.format_…Here is the HAML page: .row-fluid.span6%h2 Todo List.span6%h2{:style => “text-align:right;”} <script>document.write(today)</script>%hr.divider.row-fluid.span6%h2.small_head New Task= render :partial => ‘layouts/form_errors’, :locals => {:object => @list}.form= form_for :list, :url => {:controller =&

  • Tintin81
    ruby-on-rails ruby ruby-on-rails-3
    In my Rails app I recently tried to use a partial named _next.html.erb which simply contains a link to the next record:<%= link_to_neighbor(‘next’, @company) %>I then tried to render that partial in my show and edit views:<%= render ‘companies/actions/next’ %>However, that kept giving me an error which I was unable to track down:/app/views/companies/actions/_next.html.erb:1: syntax error, unexpected ‘=’, expecting keyword_end …_buffer = @output_buffer;next = local_assigns[:next];;@

  • Bill
    ruby-on-rails activerecord
    Possible Duplicate:Rails “find_all_by” vs “.where” In this piece of codeI was wondering what the difference between line 1 and 2.The COLUMN_NAME is either nil, or unique value.def get_rowid = “someidhere” 1 r = Model.find_by_COLUMN_NAME(id) 2 r = Model.where(‘COLUMN_NAME = ? ‘, id).firstif !r.nil?relsenilendendIs 2 more explicit than 1? What are some side effects that I should watch out for? (If id was nil, or searching for non existing id)I was using find_by_COLUMN_NAME before and I was

  • Benjin
    ruby-on-rails forms
    Rails 2.3.11I would like to use a text_field to input data under one condition, otherwise using a selection box. Right now, my code looks like this:views/posters/new.html.erb<% form_for @poster, :html => {:multipart => true} do |f| %><%= f.error_messages %><p><%= f.label :image %> – We’re not going to enlarge it for you, so please upload the biggest copy you can!<br /><%= f.file_field :image %><br /></p><p><% if current_user.admin?

  • codeObserver
    ruby-on-rails ruby oracle sqlplus
    I want to use sqlplus within ruby. Dont want to use any gems[bec I cannot get it installed on our servers without much help from other teams ..etc] and want to keep it very minimal. I am trying something as simple as this in my ruby script:`rlwrap sqlplus user/pswd@host << EOF“set serveroutput on;“commit;` #ERROR1: sh: commit: not foundsql = “insert /*+ APPEND*/ INTO table(col1, col2) values (#{data[0]},#{data[1]});”`#{sql}` #ERROR2: sh: Syntax error: “(” unexpectedCan anyone help

  • jmromer
    ruby-on-rails ruby-on-rails-3
    I generated the project with the command rails new reservation_maker -d mysql and after it was finished generating I got 4 errors. All were syntax error, unexpected ‘:’. The first was in the gemfile on the line gem ‘sdoc’, require: false. The second in application_controller.rb on the line protect_from_forgery with: :exception. The third was in session_store.rb on the line ReservationMaker::Application.config.session_store :cookie_store, key: ‘_reservation_maker_session’. The last in wrap_parame

  • Andy
    ruby-on-rails ruby
    I thought I was following this RoR tutorial to a T, but apparently not. They instructed that we write this code into apps/views/index.html.erb<h1>Listing posts</h1><table><tr><th>Name </th><th>Title </th><th>Content </th></tr><% for post in @posts %><tr><td><%=h post.name %></td><td><%=h post.title %></td><td><%=h post.content %></td><td><%= link_

  • wkhatch
    ruby-on-rails character-encoding phusion-passenger
    Ruby 1.9.2 Rails 3.0.9 ssl_requirement 1.3.2 passenger 3.0.8After updating ssl_requirement, when deploying the app I’m now getting Encoding::CompatibilityError in spawn manager exceptionsThe more details trace indicates that ssl_requirement is involved, during loading of required gems on startup:ssl_requirement.gemspec:11: invalid multibyte char (US-ASCII) /home/bill/.bundler/ruby/1.9.1/ssl_requirement-0db844a72f88/bartt-ssl_requirement.gemspec:11: invalid multibyte char (US-ASCII) /home/bill/.b

  • Jeff-Meadows
    css twitter-bootstrap
    I am new to Twitter Bootstrap and am starting to fumble my way through its use. While certain aspects of the framework are starting to make sense I am still struggling with form styling. I am trying to setup several different sections of a form which will have elements that are styled utilizing .form-inline. In one such instance I am also attempting to use .input-append with little luck.<div class=”row”><div class=”well span12″><div class=”row”><div class=”span12 form-inline

  • Refracted Paladin
    css twitter-bootstrap asp.net-mvc-5
    I created a new Web App using VS2013 and chose the (default)SPA Template. Once created I have two CSS Errors, technically for the same thing in both the min and reg version, in bootstrap.css. It goes as follows:CSS: Unexpected end of selector@media screen and (max-width: 400px) {@-ms-viewport {width: 320px;} }In particular it is pointing at the 2nd line of that code. I read the Bootstrap Docs and couldn’t find anything directly referencing this issue. See here –>Bootstrap FAQAny ideas?EDITJ

  • Sinac
    wordpress twitter-bootstrap thumbnails popover
    How to display thumbnail wordpress in bootstrap popover?I used the_post_thumbnail but this function inherently echo <img> . The resulting image is not shown in popover<?php if ( have_posts() ) : while ( have_posts() ) : the_post();/*********display the_post_thumbnail in data-content of popover *********/echo ‘<a href=”‘.get_permalink().'” rel=”popover” data-title=”‘.get_the_title().'” data-content=”‘.the_post_thumbnail(‘full’).'”>’;the_title(); echo ‘</a>’; endwhile; endif;

  • Shruthi Ramesh
    javascript jquery ruby-on-rails twitter-bootstrap
    I have cloned one rails(3.2.13) project from git repository. CSS styles are working fine. But whole javascript plugins are not loading. Eg: Bootstrap’s dropdown(nav-list) list is not showing, ajax request is not working etc. I have checked it by precompiling the assets but still it is not working. I have checked the same project with others, it is working fine for them. Please help me to solve this issue.In application.js,//= require jquery//= require jquery_ujs//= require twitter/bootstrap//= r

  • turbo2oh
    javascript jquery ruby-on-rails ruby-on-rails-3 twitter-bootstrap
    I have the following code in a partial in my rails app : http://jsfiddle.net/VYeqm/2/Its working fine in the fiddle but I can’t figure out why its not working in my app. I checked the loaded resources with web inspector in the browser and its loading bootstrap-tooltip.js. (bootstrap-tooltip.js v2.0.3). Do I need a newer version? I’ve also tried moving the script into the application.js file and either way I’m getting the following error:Uncaught SyntaxError: Unexpected token ILLEGAL Any idea wha

  • Blaine
    html twitter-bootstrap
    For some reason when I generate this using jquery to fill in my table. The checkboxes don’t come out as they should with twitter bootstrap.<tr><td align=”center”><label class=”checkbox inline”><input id=”cbox” type=”checkbox” name=”CheckGroup1″ value=”somenumber”; /></label></td><td align=”center”><label class=”radio”><input id= “box” type=”radio” name=”RadioGroup1″ value=”somenumber” /></label></td> </tr>

  • Itumac
    javascript jquery twitter-bootstrap performance-testing
    I am building out a UI Framework as an application template. It’s built on jQuery / Bootstrap. It will be used by web app developers to build data driven apps for the company I work for.There are countless screen scenarios to consider. for example, I am adding a scroll event that calls a function to fix the header if the page scrolls horizontally. My question is: If I add scroll, resize or mouse move event functions to the global frame work, how can I test their impact on performance. I don’t wa

  • LoganEtherton
    html css twitter-bootstrap
    Having created a simple registration form using Twitter Bootstrap for the UI, I find that I’ve run into an unexpected problem. You see, some of the form rows are clickable, whereas some of them are not. However, you can tab over to all of the rows and enter information, which then writes correctly to the database. So, my guess is that it’s a CSS problem. I haven’t written any JavaScript that should cause this problem.Anyone have any ideas? The page can be found here:http://loganswalk.com/efc/efc

  • Kara
    css twitter-bootstrap
    I’m trying to cover the entire page by small photos, but what i found is that i can’t cause they leave some left and right margin in the page.i’m not using js for doing that, just css and html:<div class=”container-fluid” id=”wrapper”> <div id=”home-decore”><img/> <img/> <img/> <img/> <img/> <img/> <img/> <img/> <img/> <img/> <img/> etc ..</div> </div>#wrapper{background:red;padding-top:5%; min-height: 88%;

  • bam54
    jquery tabs twitter-bootstrap collapse
    I am relatively new to JQuery, so please excuse this question if it seems trivial. I have a page, as outlined by the HTML below, with three tab elements, each of which may have an unspecified number of collapsible elements within. I am using a python dictionary called ‘groupings’ to pass data from the server, it’s structure is as follows:groupings = {tab1: [[group, [(key, value), …]], …], …}I am using Twitter Bootstrap as a frontend framework and Jinja2 as a templating engine, with Pytho

  • Ian Richards
    angularjs angularjs-e2e protractor
    I’m trying to get an e2e test running against my local server and test that the resulting url (after a navigational button has been clicked) is the correct result. However the resulting url is always false.My code is shown below:HTML://http://localhost/#/current_Page <html><head><title></title></head><body>//should change the current url to//http://localhost/#/new_page<button class=”button” ng-click=”change_page()”>Change Page</button> </html>

  • user2920788
    angularjs cookies
    I have a cookie that I am making in .net, the value of which is encoded to base 64, and is being decoded with .net also. I just want to check if the cookie exists and has a value in an angular function, the angular function that passes this off to the .net worked before I started encoding. var CookieVal = $scope.cookieStore.get(‘CookieName’);if (typeof CookieVal == ‘undefined’) {$scope.location.path(“/login”);return false;}elsereturn true;The problem with this is that it every time this runs it

  • Lior
    angularjs angular-ui
    I’m using the new angular-ui router, the one that has a state-machine included (https://github.com/angular-ui/ui-router). This great router allows a user to specify parameters as part of the URL. for example: $stateProvider.state(‘contacts.detail’, {url: “/contacts/:contactId”,templateUrl: ‘contacts.detail.html’,controller: function ($stateParams) {// If we got here from a url of /contacts/42expect($stateParams).toBe({contactId: 42});}] })(see here)this means, that when the user navigates to /co

  • Andrew Allbright
    angularjs angularjs-directive angularjs-scope
    I need to load up $httpBackend in order to mock out $http server calls (which return JSON). I’ve defined my own mocks, but when I load up my angular app with $httpBackend and my own mocks, I get an error: “Unexpected GET request: pages/main.html.” Now main.html is my main page; when a user goes to my app, this is the first page they see. I’ve looked at the docs for $httpBackend, but it doesn’t mention how to set up $httpBackend to allow normal routing behavior. I can’t find anything in stack

  • Randy Chung
    javascript angularjs angularjs-directive angularjs-scope angularjs-ng-repeat
    I’m trying to use ng-repeat in a directive that has an isolate scope, but I can’t seem to get it working.When I add an isolate scope to my directive, ng-repeat seems to not be able to see items, which I understand.However, even if I use the = isolate scope, I get the error message:Error: Syntax Error: Token ‘Object’ is unexpected, expecting []] at column 9 of the expression [[object Object],[object Object],[object Object]] starting at [Object],[object Object],[object Object]].Here is a jsFiddle

  • fessy
    angularjs
    I have in controller so far:$scope.currentPage = 0;Now, without any additional code (method) in controller I want to set opacity 0.4 on image when currentPage ==0So I wrote:<div ng-controller=”ctrlRead”> <div class=”pagination no-margin “><ul><li ng-class=”{disabled: currentPage == 0}”><a href=””ng-class=”{disabled: currentPage == 0}”><i class=”icon-fast-backward” ng-style=”{opacity : (currentPage == 0)?’0.4′:’1′}”>

  • jdp
    javascript angularjs karma-runner
    ‘use strict’;directives.directive(‘primaryClient’, function() {return {restrict: ‘A’,templateUrl: ‘views/directives/primary-client.html’,scope: {‘client’: ‘=’}}; });I’ve got a simple directive that just replaces an element with the contents of a template file. As shown above, it’s broken. The error in Chrome is Error: Unexpected request: GET views/directives/primary-client.html. Adding a leading slash (i.e. /views/directives/primary-client.html) fixes the problem.HOWEVERIn my tests, I am absolut

  • ArtisanV
    javascript angularjs backbone.js
    I have been reading the code of a few javascript libraries. I’ve noticed that AngularJS and Backbone.js both keep a local reference to array functions. e.g.: var push = [].push // or array.pushwhat is the point of doing this when arrays are a construct of the language and should be accessible globally?

  • user2584271
    jquery angularjs input
    I’m playing around with Angular JS and have a small blog feed where I have an input field with which to filter the displayed contents. Now, I’ve built my own “buzz cloud” (or whatever the word is), and am trying to implement it so that when one of the words are clicked, the updating of the input field will make the list filter correctly.But, when I set the value of my input field, the change event on it is not triggered. So I try triggering it manually with jQuery – still doesn’t work.Code below

  • doubledriscoll
    testing angularjs jasmine
    I’m writing some test for our app, and I’ve included angularjs-mocks.js so I can use the nice dsl functions that come with it. But I don’t want to actually mock the $http requests, since I’m integrating this app with a client’s backend that is constantly in flux, and I want to test against real responses.What’s the best (easiest) way to use the real http backend in this situation?EDIT:I’ve found a potential solution, which is to use this:$httpBackend.whenPOST(/.*/).passThrough()But as I mention

  • lauthiamkok
    jquery internet-explorer-8 internet-explorer-7 lightbox
    I wonder if anyone has used this lightbox plugin and encountered a bug on IE < 9 ?It keeps crashing my IE8, and IE7, but it is ok on IE9.Any idea how to fix it?or any other alternatives? I would like to use this lightbox plugin because it allows me to embed videos from youtube and vimeo. Other lightbox plugins which allow me to run videos will be perfect!Thanks.EDIT:Found the bug – jquery-1.6.min.js !!!It works fine now with – https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.jsI

  • twhis967
    jquery ipad safari lightbox lightbox2
    I’m using a modified version of lightbox that supports auto resizing within the browser. Everything works fine on my laptop in all browsers (IE 8, firefox 3.6, Chrome) However, on my client’s iPad when viewing pictures that are tall and skinny the lightbox seems to crash. I got the lightbox from this site: http://seb.box.re/2006/11/22/lightbox-2-auto-resizing-enhancementThe gallery where I’m having this problem is: http://wizdesigns.com/dev/panageries/portfolio/residential/In the Masters Residen

  • Sarit
    c# asp.net lightbox thickbox imagebutton
    Update:OK about ThickBox, I found the version that supports button but I get a message saying “Operation could not be completed” when I try to use the controls and add them in design mode. Not sure what else to do 🙁 Any idea why I get this message?I already found the Ajax Control Toolkit, but I can’t install it for some reason (with Visual Studio 2008). I also found ThickBox but I couldn’t figure out how to trigger a lightbox effect pop up window by clicking on a C# Imagebutton control. It nee

  • Paul D. Waite
    jquery load request external lightbox
    $.getScript(‘ajax/test.js’, function() {alert(‘Load was performed.’); });.. like the above code which loads an external JS on request, is there something similar available to load an external CSS stylesheet when required? Like for example when I use lightboxes (inline popups) on my site, I want to avoid loading lightbox JS and CSS files onload, unless requested by the user.Thanks

  • martin clayton
    css lightbox photo-gallery
    I have several pages made from the a template that has a navigation made with idTabs, in javascript. This is what I have in <head>:<script type=”text/javascript” src=”jquery.idTabs.min.js”></script><script src=”scripts/jquery.js” type=”text/javascript”></script><script src=”scripts/lightbox.js” type=”text/javascript”></script><link href=”css/lightbox.css” rel=”stylesheet” type=”text/css” /><link href=”css/sample_lightbox_layout.css” rel=”stylesh

  • gdubs
    c# javascript iis lightbox
    So I have a link on my aspx page that Im trying to trigger a separate html using lightbox. whenever I click the link the lightbox works fine but the html that is being loaded is giving me the error below. BUT if I use an aspx file instead of an html file it works BUT it shows the page twice! I’ve searched and I dont know if editing the aspnet_isapi.dll will really work. First of all I don’t even know where to find it. Any thoughts? Thanks!The HTTP verb POST used to access path’/test.html’ is no

  • Sjors Provoost
    ruby-on-rails twitter-bootstrap angularjs lightbox
    I have the following setup:Rails 4.0 running on Heroku jquery-rails and jquery-ui-rails gems ui-bootstrap-tpls.js from Angular UI Bootstrap (0.6) bootstrap-lightbox.js from Bootstrap LightboxUnfortatunatly when I load a page, even without an actual lightbox image on it, I get the following Javascript error:Uncaught TypeError: Cannot read property ‘Constructor’ of undefinedThis happens here:// We depend upon Twitter Bootstrap’s Modal library to simplify things here Lightbox.prototype = $.extend({

  • Olubunmi
    javascript jquery lightbox typeerror
    I am implementing a JQuery Lightbox on a website I’m working on. The same set of codes work very well in localhost, but when I transfer the codes to my server, I get this error concerning the lightbox. Uncaught TypeError: Object function Object() { [native code] } has no method ‘extend’ . I have no idea what error this signifies.Also I only have jQuery lib on the page.here is the page I’m working on mypagePlease help me.UpdateI added <script>jQuery.noConflict();});</script> within &l

  • LAntics
    jquery lightbox
    I’m having a problem. I’m using jquery.lightbox-0.5 to display images and everything works fine on my local machine. However, as soon as I upload to my server it doesn’t work.Anyone come across this?As far as I can tell it’s not a capitalisation issue.I’d be grateful if someone would be able to have a look!The site is: http://greendeco.ca/gallery.html

  • sree
    jquery lightbox
    I am trying to call lightbox popup from anchor tag.<a class=”detailShow” href=”javascript:lightbox(null,/my-account/test);”>test</a>When I click on the anchor tag ,the following error on console.logWINDOW ERROR desc: Uncaught SyntaxError: Invalid flags supplied to RegExp constructor ‘my’ page: https://localhost:9002/my-account/testHow Can I show lightbox with relative URL.

Web site is in building