Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Ruby on Rails 4.0 is the latest edge version available.

learn more… | top users | synonyms (3)

0
votes
4answers
13 views

Ruby on Rails, display the name(typ in model) of category

In my projekt i have two models, an "Treatment"-Model and a "Category"-Model class Category < ActiveRecord::Base attr_accessible :typ has_many :treatments end class Treatment < ...
0
votes
1answer
19 views

Add column to model, Rails

I want to add to my model Treatment an column, so that it belongs_to a category: class CreateTreatments < ActiveRecord::Migration def change create_table :treatments do |t| t.string :typ ...
1
vote
0answers
25 views

Send data between controllers

I have two models: Activity and Comment. Comment belongs_to :activity and Activity has_many :comments. For building activities, I've followed this Railscast (Activity feed from scratch) So, I'm using ...
1
vote
2answers
14 views

Events with multiple dates do I use has_and_belongs_to_many

Users can create multiple day events. So an event can have multiple dates, including a start time and end time for the date. So an event might have these dates: July 1 2013 9:00am - 5:00pm July 2 ...
0
votes
1answer
15 views

Rails: Adding record to a database drawing up errors?

I get this error undefined method 'model_name' for NilClass:Class when I try to add a record to my database. I have a Track model, and a Home Controller which is supposed to facilitate the addition of ...
0
votes
1answer
31 views

Ruby on Rails, instead of update make new entry to model

I made a simple demo site, with an model for the patients name (name:string) and another model with the treatment (content:text). I created this "project" to learn more about the ...
0
votes
1answer
8 views

Can't manually create user using devise becuase of 'admin' field

Using Devise,i created the user model ,and later i added an :admin field with default => false to my model using a migration. Now i need to manually create an admin user ,so in the rails console i ...
0
votes
1answer
15 views

Rails - Where MongoDB (Mongoid) stores db and logs?

I am new to MongoDB and Mongoid and I am using Debian testing(jessie/sid). When I open /etc/mongodb.conf there is no information about where Mongoid stores db and logs. It just mentions ...
0
votes
0answers
15 views

Storing Movie Sequels and Prequels

Given that I have a model that stores movies, what would be the best way to specify relationships such as movie sequels and prequels? I'd like to access these relationships using simple accessors ...
1
vote
2answers
27 views

Rails - link_to a user#show

In rails how do I do a link_to a user show page of the current user. Basically i want a link that go to a account page. I tried it but i get this. Routing Error No route matches ...
0
votes
0answers
7 views

carrierwave can not save remote url without suffix

I want to save user avatar after omniauth login by: user.remote_avatar_url = some_url The http://tp3.sinaimg.cn/1528528470/180/40013701966/1 can not be saved, but the ...
0
votes
1answer
6 views

Dynamic Navbar extracted from Model

The scenario is the following: You are building a store app where you have a category and a product model. Your navbar will contain the categories table dynamically. A DRY way of doing it would be to ...
2
votes
1answer
34 views

Get unique array of Classes

I have an array of objects: @searches It could return something like: --- !ruby/object:Profile attributes: id: 2 name: Basti Stolzi username: paintdat website: '' biography: '' ...
1
vote
1answer
26 views

How to set up the recipient id in public activity

I am going over Public Activity Gem Railscast Vid. (http://railscasts.com/episodes/406-public-activity) My current DB looks/stores everything but the recipient_id....it shows up as nil ...
3
votes
5answers
55 views

Ruby on Rails, two models in one form

I have two very similar models Pretreatment and Diagnosis, that belong to the model Patient: class Pretreatment < ActiveRecord::Base belongs_to :patient attr_accessible :content end class ...
0
votes
1answer
51 views

Why this jQuery won't work when it's loading another function?

This jQuery code should enable 2 actions. 1st action is auto-reloading page for every 7 seconds(refreshPartial();) 2nd action is auto input to chat_box field when a link is clicked. 2nd action ...
2
votes
1answer
21 views

AJAX updating todo list in Rails 3

I'm trying to convert my todo list app to use AJAX . Here is my update action of TasksController : class TasksController < ApplicationController def update @list= List.find(params[:list_id]) ...
0
votes
1answer
21 views

How do i impliment pagination here (only for the next pages)

How would i implement pagination in this case.. I am using a gem that already calculate the next pages. @client.videos_by(:tags=>{:include=>[:cover,:acoustic]},:page=>2) (page is method from ...
0
votes
2answers
20 views

How can I create a “link” to input particular keyword into input field when it's clicked?

I'm working on Rails application. If you click on that button, it automatically input @keyword into body_input I want it with link_to instead of button_to. How can I? View <%= button_to "Populate ...
0
votes
1answer
5 views

Ruby on Rails: link_to :remote=> true still navigating.

I'm new to rails, and I'm trying to perform an ajax request. Correct me if I'm wrong, but as I understand it, requests are supposed to be performed with a link_to using :remote true. I have this ...
1
vote
3answers
28 views

create action in rails

When i use scaffold in rails , controller creates various methods like new,create,show,index etc but here i can't understand transition of new action to create action eg. when i click on new ...
3
votes
2answers
47 views

How can I fetch User with regular expression?

For example, a user inputs @John_Smith hi, what's up!? I'd like to call John_Smith's object and deliver notification to him to let him notice. How can I archive that? username = @comment ??????(I ...
0
votes
1answer
12 views

Asset precompilation with Phusion Passenger, Apache and Rails

I get the following error when I try to access my Rails application hosted on an Apache server with Phusion Passenger providing the Rails code integration to Apache. I have run rake assets:precompile ...
3
votes
2answers
53 views

What can threads do that processes can't?

I would like some input on this since it would help guide as to what I should focus on in my studies (if I should consider threads at all). Are there examples of Rails application where threads are ...
0
votes
0answers
20 views

Passing RoR app user registration through JavaScript

I am trying to give user the ability to register for my site via a page other than the registration page. I'm doing this through some simple JQuery that shows the form. The code is working perfectly ...
-2
votes
1answer
17 views

Ruby render another controller partial

I have a controller and in the index view i am trying to render a partial from another controller. Here is the other controller: class ModelController < ApplicationController def view @model ...
0
votes
0answers
4 views

How to pass id from link_to to locals?

I m passing the id from link_to to locals. But it is not able to find the result, saying cannot find article without id. I need to pass the id for display articles in modal. <% @articles.each do ...
0
votes
1answer
20 views

respond_with and how to set redirect location?

I have the following that update user profile. It does perfectly fine with base url (http://domain_name.com/users/). def update @user = User.find(params[:id]) respond_with @user do |format| ...
0
votes
1answer
23 views

How upload multiple photos at the same time?? Ruby on Rails

i have a problem with upload photos. In muy view, i take some photo as below: <%= f.label :images_urls, 'image' %> <br> <%= f.file_field :images_urls, {:multiple => true} %> ...
0
votes
0answers
12 views

Add Path / Auto Load Path For Grape API Not Working

I am using Grape to build my API, and according to the documentation, I added the following lines to application.rb so that allapp/api` ruby scripts are added to the path, as well as allowing ...
0
votes
0answers
14 views

Rails issues two database queries

This is Rails 4.0.0.rc2, creating a versioned API. I've a simple model "User" with a number of fields. In the Controller's show action I would like to restrict the number of fields fetched from the ...
1
vote
0answers
10 views

Populate several Database fields based on one select_tag selection in rails

I've got a problem and am searching for the best solution. There is a form in my application which asks for data about a firm. This form consists of three blocks. In the first block I ask for data ...
0
votes
0answers
5 views

Devise custom user root is not working

After a user signs in, I want them to be redirected to /users/2 or users/44, like a normal resource. (That way an admin can easily view any user's profile page just by knowing their id.) I have no ...
0
votes
2answers
36 views

Ruby on Rails, dont create entry to model if user input is blank

Is it possible that Rails doesnt save an entry if the users input is blank and that when the user clicks on the entry key it does not redirect to the index site but skipes to the next input? Here i ...
0
votes
1answer
57 views

can't generate delete link in rails mailing view

In my view I have 2 links: one for edit, that works great, and one for destroy action. metod looks like: def create_ticket(ticket) @ticket = ticket @edit = edit_ticket_url(@ticket, :host => ...
0
votes
1answer
26 views

How to log in back to the same page when a session expires using 'devise'

A user is logged in, and his session expires. So now what I want is, when the user logs in again, he should be redirected to same page he was on before the session expired. If I try to set a session ...
0
votes
1answer
11 views

Alternate way for Starling/Workling for background process in rails 3.2

Currently we are using starling/workling in our rails application.But we are facing some issues with starling/workling background process.So we are thinking to replace it with some other better ...
0
votes
0answers
20 views

Sub-routes in Backbone.js like in Rails

all! I'm learning backbone.js now and writing small rails application using this js library. I really need your help to understand something about backbone.routing. So, I have two rails model: List ...
0
votes
1answer
43 views

How create new instance of a model in relation many to many?

I try to create a furniture object, which is in relation by a has_many_and_belongs_to with stores, this is my model: class Furniture < ActiveRecord::Base attr_accessible :area, :description, ...
0
votes
1answer
27 views

Displaying categories in a select field

Rails newb here. I have a Product and ProductCategory model, product belongs to product category and product category has many products. My seed file: product_categories = [ {:category => ...
0
votes
2answers
36 views

“undefined method” on custom helper method

I have the following custom route in my routes.rb file: match '/security_users/:id/email_confirmation/:activation_code' => 'email_confirmation#new' and want to create custom helper that generate ...
-1
votes
1answer
32 views

How to send the count value using JSON in ROR

I want to send the count value,for count the post i am using "thumbs up" gem in ror. i am using this gem Now i want to send the count in json,the vote as post action in def show def show if ...
0
votes
2answers
26 views

Creating a scope to compare 2 dates

I have a model called Feed that records two timestamps, Last_visited and Last_modified. I'd like to render a list of feeds where last_modified > last_visited I currently have this scope in my model: ...
-1
votes
0answers
46 views

Margin-left with ng-repeat working for first element only

Having a very unusual issue, and I'm not entirely sure where the problem lies. I've got an ng-repeat call that looks like this .data.row.vote-entry{ "ng-repeat" => "option in ...
0
votes
0answers
13 views

Custom Analyzer in Tire (ElasticSearch)

I am trying to create this custom analyzer and for some reason I am getting the Analyzer [] not found for field [] error... I looked around a lot and tried different implementations and I think I have ...
1
vote
1answer
18 views

Unable to install pg gem (Rails 3 - Cygwin) - sh: : command not found

When I run $ gem install pg I get the following Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. ...
0
votes
2answers
97 views

A blog using Bootstrap and Ruby on rails

I've been stuck for a time now with my commenting system on my blog. I now need you help to solv the problem and push me in the right direction. I'm using Ruby on rails and the twitter open source ...
0
votes
1answer
5 views

sort_link routing error for ransack

I've been using sort_link to sort the links on my page = sort_link(@search, :project_token, "Project ID") it works fine......but when the user filters something it takes me to the url ...
0
votes
1answer
25 views

Trying to understand Railscast episode 197 (related to previous post: #17094200)

I am trying to make this work for my page, but I need to understand the regular expression replacement. Can someone break this down for me? function add_fields(link, association, content) { var ...
-1
votes
1answer
19 views

Using CSS inside Rails 3.2.13

Checked out some links, but it seems that people who answer assume a little bit more than I know. I'm using Rails 3.2.13 and I need to add some styling to my Views. I have the ...

1 2 3 4 5 891
15 30 50 per page