Data dodania Pytanie
2018-01-16 16:01 Ruby - Re-assign values to attributes »
I have a belong_to/has_many relation between Deal and Step : class Deal < ActiveRecord::Base has_many :steps, dependent: :destroy do...
(1) odpowiedzi
2018-01-16 14:01 Helper view with multiple blocks »
I want to create a nice view helper, which looks like following (easy example, I want to make it much more complicated): This is the haml content: #...
(0) odpowiedzi
2018-01-16 08:01 Outer form updated details, but the nested form did not »
Apologies if the answer to this is obvious, but I'm only a month and a half into Rails. Basically, I have an edit restaurant form. = simple_form_for...
(2) odpowiedzi
2018-01-16 06:01 Ransack search error »
I am using Rails 4.2.5, Ruby 2.2, ransack. I am trying to implement search functionality using Ransack. I have something like: These code are in abc_...
(1) odpowiedzi
2018-01-15 22:01 Rails: How to connect submit button to controller's action to add/insert data into database? »
addPerson.html.erb file where user can fill form and submit. <%= form_for @person do |form| %> <%= form.label :first_name %><%= form.t...
(1) odpowiedzi
2018-01-15 17:01 Validate uniqueness of a value with scope - Ruby on Rails 5 »
I have table posts with a model Post and table languages (columns - id, post_id, language) with a model Language. Post has many languages and Language...
(1) odpowiedzi
2018-01-15 10:01 How to make a schedule run every week after a specific time and condition? »
Let say I want to have a schedule to get run every week when it comes to the completion date of their tasks. For example, I have a task object in whi...
(0) odpowiedzi
2018-01-13 18:01 Update Field on Click from view »
I simply want to have a checkbox that updates the todo.status = 1 onclick and then returns to the index view. <% @todos.each do |todo| %> ...
(1) odpowiedzi
2018-01-13 01:01 Rails - destroy associations from object with condition »
I have an object @foo with a :has_many associations to bar and I want before foo is destroyed all association objects from bar will be destroyed too i...
(3) odpowiedzi
2018-01-12 14:01 How to find the origin of some invasive html? »
I've been working on the site https://founderspledge.com/ and just noticed that if you go to the main page, and open the Chrome console to view the so...
(1) odpowiedzi
2018-01-12 13:01 Https request wth user auth rails »
curl -u "token:53555" https://url/method how to send token in Net::Http url, I tried as uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.po...
(3) odpowiedzi
2018-01-12 07:01 How does ransack search works on an array list? »
I am using Rails 4.2.5, Ruby 2.2, ransack. I am trying to implement search functionality using Ransack. I have something like: emails = ["abc@abc.com...
(1) odpowiedzi
2018-01-11 05:01 Authenticating multiple quickbooks apps with rails App »
I am creating a rails application that post invoices to quickbooks on behalf of users. I am using this gem quickbooks-ruby. The gem shows how only one...
(0) odpowiedzi
2018-01-10 22:01 Four products per row Bootstrap/ROR stops working with added info? »
Im having trouble using Ruby on Rail's in_groups_of method to show rows of products in groups of 4. When my code is as follows it works perfectly: &l...
(1) odpowiedzi
2018-01-10 20:01 How can I run a Rails controller action manually ("offline")? »
I need a way to run controller actions manually "offline" and store the result output. Looking into controller initialization, it seems nothing inter...
(1) odpowiedzi
2018-01-10 19:01 Disable and enable with checkbox and simple form gem »
I'm trying to disable and enable action with checkbox on the post form. And I don't know much about javascript or JQuery. And I'm trying to do this ...
(1) odpowiedzi
2018-01-09 23:01 How to retrieve and output the last record by foreign id? »
I have 2 Models in my application. Project & Note. A project has_many notes. This all works great but on the projects index page.html.erb I would ...
(1) odpowiedzi
2018-01-09 16:01 How to increase efficiency of background jobs in Rails »
I'm currently running ActiveJob with DelayedJob as the backend for my background jobs on Heroku with 10 worker dynos. Daily, I need to run ~2000+ jobs...
(0) odpowiedzi
2018-01-09 11:01 Rails Active Admin - how to set up a form's with a drop down that includes X choices plus a "free" input »
I would like to set up for an Active Admin form a field called field_example (string type), a basic dropdown that would show option 1 option 2 optio...
(1) odpowiedzi
2018-01-09 07:01 ActiveRecord where condtion on selected query result »
Borrower.joins("INNER JOIN receivables ON receivables.borrower_id = borrowers.id") .where("borrowers.type='moulde_b'") .select(" borrowers.id as id,su...
(1) odpowiedzi
2018-01-08 14:01 Is there any design pattern for using helper methods in models in Rails? »
Is there any design pattern in Rails by which i can use helper methods in models, without using include ActionView::Helpers? ...
(2) odpowiedzi
2018-01-08 11:01 FB login with devise »
I am using devise in my rails app and doing FB login via oauth I am successful in doing login from laptop but not through chrome android Error url i...
(1) odpowiedzi
2018-01-06 23:01 Ruby on Rails: Help in multiple image upload using paperclip with different process »
I have 3 models: Post, Comment, and Image (I am using paperclip gem BTW) What I am trying to achieve is that users can comment on post. Also, if the...
(1) odpowiedzi
2018-01-06 21:01 Rails select values »
I have a select option in a form: <%= f.select :role, options_for_select(User.roles.keys.to_a, params[:role]), {}, class: 'form-control form-contr...
(1) odpowiedzi
2018-01-06 19:01 How I can make admin, users, dashboard, and other settings »
I need to develop admin dashboard for my further projects. I am junior and won't become a super ruby developer. can anyone help me or show me links. ...
(1) odpowiedzi
2018-01-05 20:01 Rails 4+: only select specific columns from an included association »
I have a user model that belongs to to an account (pretty standard). On every request, I need to retrieve the current_user but I also want to return ...
(1) odpowiedzi
2018-01-05 18:01 add key in hash based on condition »
I have following method def some_method ...do something here... @customer_info = { a: a, b: b } end I want to add key c in ...
(2) odpowiedzi
2018-01-05 16:01 Runsack gem, scope, date range , menu »
I have a model Signal with nested models Steps I want to implement a search method to: -[1] select a date range from a menu (e.g. all Signal related...
(0) odpowiedzi
2018-01-04 12:01 Rspec and environment configuration file »
How can I force Rspec to get config from config/settings/test.yml ? I use gem "config" Inside Rspec folder i have rails_helper.rb file with: ENV['R...
(0) odpowiedzi
2018-01-04 10:01 bundler: not executable: bin/rails »
I'm trying to create a cron job that runs a model method with the whenever gem but i'm having trouble. I'm getting schedule.rb every 1.hours do r...
(0) odpowiedzi
2018-01-04 08:01 Dynamic size styling in paperclip »
I have searched for this, I got the some idea from Resize missing.png depending upon style in paperclip but not the exact solution of the following sc...
(2) odpowiedzi
2018-01-03 10:01 How do i track view count of different div blocks on single page while scrolling without clicking them »
I have many cards (div blocks) in my single page application. I want to track view counts when the user scrolls through this page. Means whenever one ...
(1) odpowiedzi
2018-01-02 20:01 Why is a join record being created for this model? »
This is a web app for scheduling our company's various site deployments among the developers and product owners on our Scrum team, when we launch upda...
(2) odpowiedzi
2018-01-02 19:01 Should I use hashes or ActiveRecord::Relations? »
I'm really lacking some knowledge regarding efficiency/performance when working with massive amount of data. I need to do some calculations on differ...
(0) odpowiedzi
2018-01-02 19:01 NoMethodError - undefined method `status' for nil:NilClass »
I am trying to work through my table and pull out and list each of the status types under their own heading. When I run this I get NoMethodError for T...
(2) odpowiedzi