-1
votes
0answers
7 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
1answer
17 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
9 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
2answers
35 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
52 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
17 views
How to log in back to the same page when session expires using devise
A user is logged in, 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
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, ...
-1
votes
1answer
31 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
1answer
26 views
Setting notifications with followers using public activity
I am going over Public Activity Railscast. (http://railscasts.com/episodes/406-public-activity)
Everything works fine when a given user likes a dailypost. A notification is created which can be ...
0
votes
2answers
24 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:
...
0
votes
0answers
10 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 ...
0
votes
2answers
91 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
2answers
20 views
Rewrite object.count(conditions: [ ]) SQL query
I have a question and answer model, answers belong to questions and a question has many answers. Answers have a boolean :correct column so answers can be marked as correct.
The code below checks ...
1
vote
0answers
10 views
CommunityEngine Rails3 Git-Error
I'm a newbie in Rails3 but i will be only install CommunityEngine. I followed this tutorial, but I could not get it to work.
This is the error:
root@develoepr:/home/pthoelken/cengine# bundle ...
0
votes
0answers
21 views
f.select options list outputting everything just want categories
Im using this code in my views
= f.select :submitted_by_eq, PropertyApplication.all.map{ |c| [c.submitter.try(:full_name), c.submitted_by] }
But in my views it outputs everything in the record i ...
0
votes
2answers
14 views
Validation association not working
I have two models: Location and User. Location has_many :users and User belongs_to :location. Now I have a form that uses something similar to:
<%= form_for @user do |f| %>
...
<%= ...
-1
votes
0answers
11 views
State Machine or Multi Step Form for User Registration
In a Rails project I have a Polymorphic User model that I need to create a multi-step registration process(Signup as different user type, create group, select subscription type, etc). Would it be ...
0
votes
1answer
51 views
Model naming convention for Rails
Override Rails controller routing with capital letters in model name
I followed that question and answer, but it did not help me.
I need to create a model from an already existing table, BBOrders.
...
1
vote
1answer
38 views
Retain nested form field value after failed validation
I am new to rails and have not yet managed to solve the following issue. I use devise for authentication with a model called "user". This model is associated to another model called "company":
...
0
votes
0answers
15 views
Client side validation errors are not updated when an error is fixed
I am using client_side_validation gem with Rails 3.
I have input field which is validate as require true (:presence => true) and numericality (:greater_than => 1000) both. Validation is working fine.
...
2
votes
1answer
42 views
How to specify a record with a date greater than another date?
I have a record called Feeds that contains the field 'last_visited' and 'last_modified', both are timestamps.
I'm trying to render a list in a view of alls Feeds where last_modified > last_visited.
...
0
votes
0answers
16 views
How to read JSON files from several gems in a Rails app?
I have a Rails app and a few gems it requires. Each of those gems needs to send a JSON file to the Rails app, which will in turn merge them with it's own JSON config file and POST those to another ...
0
votes
1answer
28 views
Error on creating Rails new project (../config/boot (LoadError)
Getting this error on Rails new project setup. Any clue?
$rails new my_project
/home/ankit/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': ...
0
votes
2answers
27 views
Change scope based on parameters
How would I change a scope on a chain dynamically based on a parameter in the URI?
For example:
http://www.example.com/object?status=approved
would lead to the ObjectController#index:
def index
...
0
votes
1answer
13 views
Button event trigger
I am having trouble understanding as how do you trigger specific button event when using Ruby on Rails. For example I have a mini form inside a table as so (View side of MVC):
<%= form_tag do ...
0
votes
1answer
38 views
Can't convert from Fixnum into String
I am using the rmeetup gem to grab information from the meetup group.
When I try to pull information from the results, all works except time and I receive a 'can't convert Fixnum into String'
My ...
0
votes
0answers
11 views
Awesome nested set: Performance improvement for self_and_descendants
Recently started working on a existing project which heavily relies on awesome_nested_set gem and used one of it's method's self_and_descendants refer here
This method is too heavy in terms of ...
0
votes
2answers
34 views
Disallowing users to view others posts
I have a page that shows posts that another user makes, and I was able to make it so that if you go to the index, it only shows posts who's user_id is = to the current users user_id. But if i go to ...
0
votes
1answer
18 views
Getting values of raw SQL call from Rails
I have this little bit of code info in the controller:
@today_date = Time.current.to_date.strftime('%Y%m%d')
client = TinyTds::Client.new(:username => 'tr', :password => 'tr', :host ...
0
votes
1answer
14 views
How to inherit page from rails application.html to locomotive index page?
I am using locomotive cms for our new project. Which uses rails 3.2.13, Ruby 1.9.3 and mongodb.
As client wants to edit some of the pages(around 10), so we decided to integrate locomotive to existing ...