Tagged Questions
0
votes
0answers
9 views
Upload file with paperclip and angularjs
I'm trying to implement this Angularjs upload in my rails application:
Angular File upload
This is my photos_controller:
def create
@photo = current_user.photos.new(photo_params)
respond_to do ...
0
votes
3answers
13 views
Angular $http post() format Defaults to HTML on Rails
I have a factory that exposes a create() function which uses $http.post() underneath. For some reason when it is called from an ng-click the request is being formatted as HTML. All of the params are ...
-1
votes
0answers
22 views
POST request hangs
I'm sending a POST request to get back a filtered report. I send my first few and they are pretty quick, no more than a second or two. On about my third request the request seems to hang, and doesnt ...
0
votes
2answers
20 views
Create a record in Rails from AngularJS
I have an Angular application that sends http requests to a rails server. I'd like to make a request to create a record (in the table SavedQueries).
The Angular app is actually making a very simple ...
3
votes
1answer
30 views
Can you use AngularJS with Rails Models
If the title question is unclear, let me clarify. Though the question is conceptual, rather than physical.
I have a rails application with a few models (order, buyer). I recently discovered angularjs ...
0
votes
1answer
14 views
AngularJS application not downloading file
I have a rails server that generates a csv from an http request, like this:
@results = some_json_string
require 'csv'
csv_string = CSV.open("results.csv","wb") do | csv|
...
0
votes
2answers
33 views
How to serve a file for download from Rails?
So this is probably a simple question, but I've never done it before.
I have a Rails action that queries a database and creates a csv string from the query result.
I'd like to take the query string, ...
0
votes
0answers
15 views
Rails 4 + AngularJS: templateUrl for directive not found?
I'm trying to create a directive in AngularJS to split my HTML into reusable partials:
app/assets/javascripts/products/directives/products.js:
app.directive('productsfilter', function() {
return {
...
0
votes
1answer
34 views
interpolating a '#' in a rails url
I have a a webpage which has different tabs. The tabs used to be different pages, but now through angularjs they are effectively a 'single-page' with no loading between each clicked tab.
So every URL ...
0
votes
0answers
15 views
Angular - Performance/Crawl-ability - Json to Jeykll - Thoughts? [on hold]
I've considered a rebuild of Lionseek.com (Moving from CodeIgniter to ROR + AngularJS) - millions of pages/millions of pageviews a month/updated every minute or so.
Since most of the traffic is ...
1
vote
2answers
30 views
XMLHttpRequest No 'Access-Control-Allow-Origin' header is present on the requested resource
So there are a handful of questions on StackOverflow addressing this error, but of the 10-15 I checked, I could not find a solution to my exact problem.
I am running an Angular app (port 9000) and a ...
0
votes
0answers
6 views
Rails + Selenium: Tests fail if asset is loaded by AngularJS
I need to dynamically load image URLs using AngularJS. They work in my development and even in my tests I can see the images uploading properly through the browser that Selenium opens. However, my ...
3
votes
1answer
31 views
Angular + .nghaml template: Referencing Precompiled Image Assets
I'm using .nghaml for my templates and using the following gems for Angular integration:
gem 'angularjs-rails'
gem 'angular-rails-templates'
My Rail view layouts are name.html.haml and using ...
0
votes
0answers
9 views
Rails 4 + Angular + Selenium: No route matches [GET] “/%7B%7B%20product_color.color.image.url%20%7D%7D”
I'm getting the error: No route matches [GET] "/%7B%7B%20product_color.color.image.url%20%7D%7D" when I use selenium with my cucumber tests even though all the images are loading properly (I sleep 10 ...
0
votes
0answers
18 views
AngularJS + Rails 4: including $location provider causes all links to stop working?
In my Rails 4 app when I land on a particular page (my products#show page, ex: /products/30) and I click on any of the links on the page, the browser doesn't move. However, the URL changes with each ...
0
votes
2answers
27 views
Repopulate Angular app data with new data from form submission from a rails api
I have a rails api that sends default input to an Angular app. The angular app receives json at localhost:9000/api/query, and then the view at localhost:9000/#/query styles that json into an unordered ...
1
vote
1answer
23 views
My ng-change is not firing on my Angular/Rails app
I am building a notecard application and for some reason my ng-change is not firing at all. I cannot figure out what the issue is. I tried breakpoints in the JS to verify that it is not actually ...
0
votes
1answer
30 views
angular ui router, back button does cause state change
I'm using angular in a rails app and have ui-router set up with several states.
name: 'item'
url: '/items'
child states
name: detail
url: "/{item_id:[0-9]{1,4}}/detail"
parent: item
I'm ...
0
votes
1answer
16 views
ActiveRecord::RecordNotFound in Api::V1::PostsController#show
I am trying to follow Rails Todo API Part 1 from egghead.io https://egghead.io/lessons/angularjs-rails-todo-api-part-1
I am trying to access localhost:3000/api/v1/posts and the page should show the ...
0
votes
1answer
15 views
Rails 4 routes + AngularJS: How would I grab the products/:id parameter?
I'm trying to use pure Rails routes with AngularJS controllers. How would I grab the product id (30) of /products/30 in my Angular controller if the route is being generated by Rails?
...
-1
votes
3answers
33 views
How can I submit a new query in an angular application?
Let me start by saying this: this is my first forray into angularJS.
I am building an angular app with a feature where you can write sql directly against a database. Security issues aside (I am the ...
0
votes
0answers
13 views
How to get an instance variable from rails using angularjs and ui router?
I'm using a template in my state router. I want to get an instance variable from my rails server, but it doesn't have it's own path, so I can't use Restangular or something like that. Also, when I ...
0
votes
2answers
29 views
Error: Argument 'HomeCtrl' is not a function, got undefined
I get the following error:
Error: Argument 'HomeCtrl' is not a function, got undefined assertArg@
This is what my code:
in main.js,
var my_app = angular.module("my_app",[]);
var config = ...
0
votes
1answer
15 views
ui-sref not working approperly
I have a very basic angularjs app, using ui-router. The stateProvider is defined as follows:
$stateProvider
.state 'home',
url: '/'
.state 'products',
abstract: true
url: ...
0
votes
0answers
41 views
angularjs:-Improve performance of site
My team has made a website using angular js and ruby on rails as its backend..The issue I am getting is that when the javascript is precompiled and when it comes on the browser,the size of the ...
0
votes
0answers
34 views
Rails 4 + Angular: Already Bootstrapped with this Element '<body class=“ng-scope”>'
I'm on Rails 4 + turbolinks + the angular-rails gem : https://github.com/hiravgandhi/angularjs-rails. I only want Angular on one specific page, so in my index.html.erb view I have this:
<% ...
1
vote
0answers
29 views
How to organize many Angular.js constants?
I am working on an Angular.js and Rails application, and am using asset_path(...) calls for all my templates. Instead of having these littered all over my app, I'd like to have them stored in a single ...
0
votes
1answer
16 views
Render html of angularjs instead of default rails html
I want use angularjs in rails application and I'm new to angularjs. For this, I add angularjs file to project and created the below scripts and html:
HomeCtrl.js.coffee
@restauranteur.controller ...
1
vote
0answers
26 views
Rails REST API permissions (CanCan) with Angular JS client. How to render UI based on permissions?
I'm building a project which works only via JSON API (Rails 4.0, PostgreSQL). It's a big application with database based permissions. And I have AngularJS app which works with this REST API.
...
1
vote
0answers
24 views
AssetFilteredError while working on rails with angular
Following this angular rails tutorial, getting the error of Asset Filtered error
application.html.erb file is
<!DOCTYPE html>
<html ng-app>
<head>
<title>Blog</title>
...
0
votes
1answer
21 views
ng-href link not followed on Firefox
I'm using ng-href which seems to produce the correct results, and the correct behaviour on Chrome but not on Firefox.
on the page www.mydomian.com/clubs/ in my rails app i have the Haml
...
0
votes
1answer
29 views
pass parameters from angularjs to rails project
I have 2 project: 1.rails project. 2.angularjs project.
In the rails project, I have a widget model that I create by scaffold. Now I want get widget data from angularjs project and post data to rails ...
0
votes
1answer
22 views
ngAnimate in Rails, I just want to hook it up
why is it always so hard to hook things up to AngularJS?!?!?!
here's the error I get for anything new I try to install to Angularjs:
Error: [$injector:unpr] ...
3
votes
1answer
44 views
Use of Angular's ng-src in Rails Production environment
I'm building a simple AngularJS app in Rails - when compiled in Heroku / production - the ng-src is linking to the proper path but not producing the standard minified images even when used in ...
0
votes
0answers
42 views
HTTP:No 'Access-Control-Allow-Origin' header is present on the requested resource
I have 2 project:
rails project.
angularjs project.
Now I want use rails models in angularjs project. I have a widget model that I created by scaffold. Now I want add a new widget from angularjs ...
0
votes
1answer
26 views
socket.io/1/?t= not found
I have a web app that is running on rails 4 at localhost:3000. I am also have angularjs on client side. I have placed scoket.io.js file in my rails app public folder. From my angularjs client code, I ...
-2
votes
0answers
19 views
Controller is not using AngularJS commands
I am learning rails and angularjs... I started with a basic app. My controller is not taking my angular commands. I have been trying to break my head... It should be too simple, sorry guys... But ...
3
votes
1answer
23 views
Problems with angular promises' responses in services
I'm working with angular 1.2.18 for the first time. I am using it with rails 3.2 and coffeescript. I am trying to use a promise in a service to fetch some data that I will then use to populate a ...
0
votes
1answer
40 views
use angularjs in rails project
I want use angularjs in a rails project and I'm new to angularjs. for this, I create a staticpage controller with index action. I set this page for root page:
config/routes.rb
...
0
votes
2answers
64 views
CRUD operations using AngularJS and Mongoid fail partly
I am trying to integrate AngularJS into my Mongoid-powered Rails application. In particular, I want the get the basic CRUD operations to work.
1) Saving a book works!
2) Editing fails: Error: ...
-1
votes
0answers
23 views
Not able to call $http.put and $http.delete cross server in angularjs
I am able to call the $http.post and $http.get methods on other server from angularjs controller but I am unable to call $http.put and $http.delete cross server.
I run my api server in port :3001, ...
0
votes
1answer
30 views
Performance:-How to reduce precompiled js file size in angularjs and rails
I am working on a website which is based on angularjs and rails in the backend.
The site is currently in production/live
The issue which I am having is that after the assets have been precompiled ...
0
votes
0answers
16 views
AngularJS ui-utils ui.scroll doesn't display results
I have a rails 4 application using AngularJS.
I am attempting to create a prototype using the ui.scroll directive from angular's ui-utils modules.
My rails API is working great when I use ng-repeat, ...
0
votes
0answers
30 views
Getting nested resources from Rails with Restangular and ui-router with AngularJS
So here's a weird one:
I'm using the ui.router with Restangular in AngularJS, and when I want to get a specific resource I can do:
Restangular.one('books', $stateParams.id)
and then in rails:
...
0
votes
0answers
34 views
Angularjs url remove hash not using html5
I know one possible way to remove '#' from AngularJs route url is to enable html5 mode. like:
$locationProvider.html5Mode(true) if window.history && window.history.pushState
This is work, ...
0
votes
2answers
86 views
AngularJS Template Url not working
I am trying to set a templateUrl on a route in AngularJS using an html file in a child directory of assets. It works fine locally.
The templates are stored at: #{RAILS_ROOT}/app/assets/templates
# ...
1
vote
0answers
48 views
how to pass data from modal to function
i have a modal form that has several input text form control. How do i pass the data to post to the data base so that ng-grid gets updated?
do i call my ajax create function within the $scope.open ...
0
votes
0answers
23 views
Trying to Use 'Angular Rails Templates' gem
so, I'm trying to use the templates folder in AngularJS instead of the 'views' folders that you'd normally use in Rails.
Things work great when I write everything in html, but what if I want to write ...
1
vote
3answers
77 views
delete row(s) from ng-grid table from button
I have a table with ng-grid, and the problem is that i'm not sure how to collect the selected row(s) id or variable to pass into my delete function.
here is a quick mockup of what i'm trying to do
...
1
vote
0answers
22 views
How to use AngularJS with Rails Form?
I'm using simple_form with AngularJS:
= simple_form @post do |f|
= f.input :title, input_html: { "ng-model" => "title" }
It works great for my scenario on new post, but for editing on existing ...