Search Posts

Category: ruby-on-rails

Rails angularjs : Not accessin the dabatabase

My Angular controller is not accessing the database. I am working with the action ‘index’ for testing purposes. It does display the angular view but with no information. I am manually typing: localhost:3000/tickets/index to test if it works. I have a small personal project, which I developed in rails. Now I am trying to gradually change the front-end to Angularjs. I have a model $ controller working on Rails “PrintingTicket”. Because I don’t want to […]

angularjs how to put array in my url

im getting multiple month in my url here my problem i get of object instead of a name of the months that i choose as you can see in my url i got object months=%5Bobject%20Object%5D i want to see like this months = [mar, apr] here my view in that particular combobox md-input-container flex=”” label Months md-select ng-model=”params.months[month]” multiple=”true” md-option ng-repeat=”month in ctrl.months ” ng-value=”month” | {{month}} here my controller #= require ./../../module class IncomeStatementIndexCtrl […]

Rails Submit Buttons Not working (name="commit")

I have a Rails 5 application using only AngularJS, no jQuery/Turbolinks. Typical submit buttons generated by form helper do not work in this application (go immediately to disabled) without submitting the form, and I’ve resorted to using button_tags with type=”Submit” instead. If I remove the “name=’commit’” atribute from the submit button, it works as expected by submittin the form. I’m wondering if there’s something bound to this attribute that I’m not seeing. Below is an […]

Multiple Angular requests cause errors within tests

I’ve got an Angular 1.5 app with a Rails 4.0 backend and I’ve got this problem where in my tests once a Staff member logs in 3 queries are sent to the backend at the same time. In testing (using Capybara + selenium + chromeheadless) this causes these requests result in errors on the backend. In development it works fine. An example of the error; NoMethodError at /entities/get_current_entity ============================================= > undefined method `fields’ for nil:NilClass […]

how to Angular2token post name?

After setup device + rails api and create a register component. After create a user and check on db the User just commited the email and password. But, i added the name and nickname on form fields. Someone have any tip to spare? or is with the same issue? Rails console User Load (0.6ms) SELECT “users”.* FROM “users” ORDER BY “users”.”id” DESC LIMIT ? [[“LIMIT”, 1]] => #<User id: 5, provider: “email”, uid: “[email protected]”, name: […]

AngularJS – Is it possible to store {{expressions}} as a $scope.variable value?

I am building a Rails app but using AngularJS for bits of the front end. Is it possible to store {{expressions}} as a $scope.variable value? Code: Here is the angular controller // I am pulling data from the rails controller via the gon gem. $scope.entertainmentTemplate = gon.active_entertainment_template.description; Which translates to: $scope.description = “{{productName}} is a great product and also has awesome {{additionalInfo}}. These are some more example words, blah blah..”; Defined variables in angular controller: […]

Firebase auth or angular2-token?

For a mobile and rails API is better use firebase auth or angular2-token for authentication? Seems that Firebase Auth is more suited for mobile with ionic but if you would like to use Rails API as backend to provide a web service with Angular? so, please give your thoughts! Source: AngularJS

Ruby On Rails: How can I read text from other sites that are written by angularjs

I want to read the value 10059 from another site. It contained in the p tag looks like this, and i want it. <p class=”currency_desc”>10059 usd</p> What I did in rails app: require ‘nokogiri’ require ‘open-uri’ doc = Nokogiri :: HTML (open (‘’)) content = doc.to_html …. …. But the content I got about it was not what I wanted, because it was written by angularjs ? <p class=”currency_desc”>{{ buy_rates}} usd</p> How do I do […]