Data dodania Pytanie
2016-12-16 23:12 Rails 3 HABTM yields ActiveRecord::Associations::CollectionProxy objects »
I have a legacy Rails 3 application and I'm trying to set up a simple HABTM relationship between two models: VolunteerCircle and User. I have this s...
(1) odpowiedzi
2016-12-16 11:12 How to get Condition Group in Ransack? »
I am using advanced search in Ransack which has default AND. I have made it as OR by putting .try(:merge, m: 'or')) @search = Data.search(params[:q]....
(0) odpowiedzi
2016-12-15 21:12 Change the value of hash »
I have a array of hash response = [ {"id"=>"008CFA1213EA1479500703798", "updated_at"=>"2016-11-18T20:27:03Z"}, {"id"=>"F4521445787014794...
(0) odpowiedzi
2016-12-15 15:12 Rails: Cannot access column from a join-table in a partial »
I want to access a column from a join-table in a partial. When I access this column in a "normal" view (e.g. fakeposts#index) it is working, however i...
(1) odpowiedzi
2016-12-15 14:12 Limit Ransack drop down options »
I am using Ransack and it is working really well on our Data model. Now the issue is, in the dropdown, it shows us all the 15 option like id, name, ag...
(0) odpowiedzi
2016-12-14 13:12 Rails - Model with attributes, which are not stored in the database »
The whole project is build like that: I've got an api which provides data and saves data. Than another Application which converts the data of the data...
(2) odpowiedzi
2016-12-14 10:12 A script to install everything from scracth »
#!/bin/sh ## update & upgrade sudo apt-get update sudo apt-get upgrade ## install rvm with ruby & rails gpg --keyserver hkp://keys.gnupg.net...
(2) odpowiedzi
2016-12-14 09:12 Rails 3 how to validate additional columns using Rakismet gem »
I am using Rakismet(1.5.3) gem in my Rails(3.2.22) project. Rakismet validates attributes such as author, author_email, author_url, content by default...
(0) odpowiedzi
2016-12-13 23:12 Rails: handling errors within respond_to block (csv) »
I have a search method on my controller that responds to either the html or CSV format. The html format renders the search results as expected, and I ...
(1) odpowiedzi
2016-12-13 22:12 Why does Time.parse fail in Rails 4 and 5 but not in Rails 3 for date strings with a space between the date and time? »
In investigating a bug I ran into after upgrading an old Rails 3 app to Rails 4, I noticed that Time.parse fails when this date string contains a spac...
(3) odpowiedzi
2016-12-13 14:12 Could someone explain the following Ruby on Rails error? »
LoadError in CandidatesController#create Unable to autoload constant Usermailer, expected Z:/railsassignment/student/app/mailers/usermailer.rb to ...
(2) odpowiedzi
2016-12-09 07:12 Views in ruby on rails »
I am learning to code in ruby on rails environment. I created two models cars and products. I want to have a main page which have a link to cars and p...
(4) odpowiedzi
2016-12-09 01:12 How do I auto format Ruby or .erb files in VS Code? »
I press ⇧⌥F in VS Code for Mac, the shortcut to Format Document, to format a file called "foo.rb" or "foo.html.erb". Instead of formatting the do...
(1) odpowiedzi
2016-12-08 23:12 Rails 3 - Including external routes within main routes.rb file »
I have a config/routes.rb file in which I'd like to include, at the very bottom before a match statement that acts as a catch-all for invalid urls to ...
(0) odpowiedzi
2016-12-08 19:12 How to wrap the returns of method to one div block »
I'm creating like model in rails application. To use images in tooltip I need to wrap them all to: <div class="tooltip"> The main method is: ...
(1) odpowiedzi
2016-12-08 15:12 Rails: Getting timestamp when user visits "new" page (and save it into the database) »
I want to save the timestamp when a user visits the posts#new page (.../posts/new) for the first time and save this timestamp in the posts table in th...
(1) odpowiedzi
2016-12-07 23:12 Rails model association to hold each month data »
Could not find a appropriate title to this question sorry for that. I have a car model. I would like to keep the data of daily and hourly price for ...
(1) odpowiedzi
2016-12-07 22:12 RSpec and FactoryGirl »
I currently have an RSpec test: Rspec.describe Some::ServiceClass do args = ['1', '2'] subject { described_class.new(args) } ...
(1) odpowiedzi
2016-12-07 01:12 I need help to write the rspec test in rails »
I have a items_controller.rb def get_serialized_copy_of_item @item= Item.find_by_id(params[:id]) if @item.nil? head :no_content ...
(2) odpowiedzi
2016-12-06 18:12 How can I have the names of the authors of my followed books? »
In user.rb (models) I have this : has_many :followed, class_name: Following has_many :followed_books, through: :followed, source: :book In followed.r...
(1) odpowiedzi
2016-12-06 14:12 How to pass service objects/modules as arguments in ruby »
Is it possible to use Module or objects as arguments for each method in ruby? I need something like. module PrintAny def call(text) puts text ...
(2) odpowiedzi
2016-12-06 10:12 Splitting response of Savon »
Somehow, the webservice I am using savon to deal with returns this response {:do_deal_response=>{:do_deal_result=>"Code=000&CardNumber=000...
(2) odpowiedzi
2016-12-05 10:12 elasticsearch alias with rails »
I am using rails with elasticsearch, thanks to the elasticsearch-rails gem ( https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-...
(0) odpowiedzi
2016-12-05 09:12 Generating a code failed on afterr_save call back on rails »
I am trying to adding a unique value in a table column when the record is saved. Assume my table have 3 fields : < Job_Code > In my POST reque...
(2) odpowiedzi
2016-12-03 13:12 Ruby on Rails Convention over Configuration (CoC) Issues to scale Large Rails Project »
Working with Ruby on Rails for somewhile now. I'm enjoying it's builtin "Convention over Configuration" for small project. But, I'm little anxious abo...
(1) odpowiedzi
2016-12-02 18:12 Fields for not working with nested attributes rails »
For some reason fields_for is not showing my nested attribute text boxes. I have followed the guide on how to get it to work but still zero luck. Any ...
(1) odpowiedzi
2016-12-02 14:12 Add custom class to simple_form_for association of type option - Rails »
I'm using a simple_form_for with a association = f.association :type, :collection =>version_name,:label => "Application type:", :selected =>...
(1) odpowiedzi
2016-12-02 02:12 is it possible have ruby read 12:34 as a integer? »
I'm working with a script that only takes integer values. I'm reading from a CSV with a timestamp example of 12:34. Is there a way I get ruby to read ...
(1) odpowiedzi
2016-12-01 22:12 How do I convert MAC address to formatted MAC address »
Input: 009CFAEEB779 Output:00:9C:FA:EE:B7:79 I was searching for the method but didn't find. Is there any method? or I need to loop(map) through it ...
(1) odpowiedzi
2016-12-01 19:12 Rails - How update data in table when user clicks on submit button »
I am using Rails 3.2 and have this page where I am showing a table with a list of results, passed to the view through a @jobs variable which are resul...
(2) odpowiedzi
2016-12-01 17:12 Use coffeescript or javascript in rails form to grab model attribute »
I am working on a Rails app and need some help with coffeescript which I'm not very good at. I have a form with a field called location_id using a co...
(1) odpowiedzi
2016-11-29 14:11 How to use joint query in this association - Ruby on Rails »
I am working in ruby 2.1.5 and rails 3.2.1. I want to list all the company in grid which is associated to company_name = John Company table: compa...
(1) odpowiedzi
2016-11-29 09:11 How can I allow multiple error rendering messages in rails api response »
I am trying to render error messages if any of the condition fails. How can I pass error messages related to failed conditions But it gives me Abstra...
(3) odpowiedzi
2016-11-28 19:11 Use hmset / hmget in REDIS: WRONGTYPE Operation against a key holding the wrong kind of value »
I am trying to use hmset / hmget to store hashmaps associated to a key in REDIS as such: def self.store_id_and_phone(id, phone) key = generate_key ...
(0) odpowiedzi
2016-11-28 17:11 includes method in Ruby on Rails 3 »
Why does includes method behaves like select distinct One blog has many 10 comments. includes output remove same record. But find_by_sql doesn't remo...
(0) odpowiedzi