M
M
Max2015-11-18 19:01:34
Angular
Max, 2015-11-18 19:01:34

How to pass data from rails to angular?

Hello, I want to understand the issue of implementing angular in rails. While I want to create a simple table filter. But I don't understand how to pass data to the front-end. Help with advice or throw off the necessary literature please.
update

<% @users.each do |user| %>
      <tr>
        <td><%= user.name %></td>
        <td><%= user.age %></td>
    <% end %>

def new
    @user = current_doctor.users.new
  end

When I click on a button, I need to display only people with an age of, for example, 25 years. I understand that it is necessary to make request to a DB. Tell me where to write it and how to call please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-11-18
Protko @Fesor

angular separately - rails separately, rest/http api in between.
And for this you are trying to shove angular there? I think you're choosing the wrong tool.

A
Alexander Korolev, 2015-11-18
@kunashir

Good afternoon.
Just give the data in the controller in json
Example at the link: https://github.com/kunashir/requitement/blob/maste...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question