Save 36% for Black Friday! Learn more

Ruby on Rails Community Forum

Where do this code go? (Refactoring Rails Workers)

5
Rails
Hey! I have two different workers ``` #app/workers/website_worker.rb class WebsiteWorker def perform(website) do_this_action(website) end def do_this_action(website) ... end ...
Arjun Rajkumar replied
Solved

Improve on these ActiveRecord requests?

4
Rails
I am trying to get the top 5 products, based on the impressions that product has recieved. Now the code below is working ok, but its not in the right order, and I cant work out a better way to get...
Alan Reid replied

Is there a better solution that Paperclip to manage profile pictures ?

5
Gems / Libraries
Hi everyone, I'm asking this question because it seems pretty hard to setup, between Image Magick and all the mecanics there is to put to work... I saw there was another solution Carrierwave but w...
Damian Nelwep replied

Do I have to create a controller for users using Devise or where can I find its actions ?

2
Rails
I'm having some trouble setting up Paperclip gem to setup profile pictures for the users of my app and I need to access users_controller. Since I'm using Devise, I don't really know where I can fin...
kadammanali987 replied

Accepts_nested_attributes_for, I am getting 'unpermitted parameter: :user' and User not entering to DB.

1
Rails
Hello! I am building an app with Accounts/Users & Memberships via has_many through. I am using Devise and want to create a new user from 'accounts#new" via 'accepts_nested_attributes_for.' Whe...
Ryan Mindigo replied
Solved

How do I create my homepage subdomain ('www')

8
Rails
Hi, I followed the tutorial for subdomain from scratch and got " redirect_to root_url(subdomain: "www") if @account.nil? " but I don't know how to get to manage it as a homepage like home#index. ...
Damian Nelwep replied
Solved

How do I create an app with Urls like 'https://username.website.com/' instead of 'https://website.com/username/' ?

17
Rails
Hello everyone, I searched but didn't find anything and was hoping like I said in the title of this subject, to find a way to get the url displaying a user's profile of a client's app to be like u...
Chris Oliver replied
Solved

How to optimize the work of clients from different countries?

1
General
My server is located in Norway. My clients live in Norway, Japan, Hong Kong, USA and South Africa. Due to the fact that the server is located in Norway, the ping for customers is very long. I'm usi...
xxx44yyy replied

Professional grade authentication with a single command (in rails 5)

2
Rails
I've built authentication a few times now, and every time it's been 99.9% the same (save for a few tweaks in form validations etc). The machinery has been more or less identical to that found in th...
S C replied

How might I handle event-sourcing?

2
Rails
I've *never* been happy with the way I've implemented certain kinds of features: * Notifications * Some kinds of reporting * Activity Feeds Then, I saw two things: 1. The "bucket/recording" patter...
Chris Zempel replied

Easy Autocomplete

0
Javascript
Hello everyone I was using easy-autocomplete plugin for my project and its working well thanks to this site but I reilised this plugin can put html tags too and I cant avoid html tags injections. A...
Mehmet Şamil Büyükçağlayan posted

How update value which run from strong params??

1
General
I have action(strong parameters) in controller: ``` def home_task_params params.require(:home_task).permit(:subject, :description, :data) end ``` i want do something similar to this ``` def c...
Ryan Mindigo replied

Raisl 4 : Exception Site(#70058148983820) expected, got String(#8388700)

0
Rails
I have a form with a selectbox which allow to select differents values. When I want to save the form I have an exception : ActiveRecord::AssociationTypeMismatch at xxxxxxxxxxxxxxxxxxxxx S...
Laurent Passebecq posted

migrating to php

2
Ruby
Hello, I have inherited a ruby application and unfortunately have no knowledge of the language. Could someone be so kind to help me figure out how to convert the below code to php? ``` def genera...
vampster replied
Solved

Stuck on creating new record

4
Rails
I'm not sure why I'm so lost on this one, I dont rally have a ton of experience with Rails but I did a blog with basic CRUD functionality and that was all good but this new project its just giving ...
Nelson replied
Solved

Trying to setup a Telegram bot, sorted everything out, but have one error

0
Ruby
If you are experienced with CMD, Ruby, NodeJS and Windows 10 then please help. Error: https://i.gyazo.com/23c684b3788c3190d7a81f53bb828e30.png I've run the commands that are displayed to resolve t...
Danny Woodward posted

How to get param values through radio_buttons ?

2
General
I'm trying to create a TARGET with a responsible user via form_with: ``` <% @users.each do |user| %> <%= f.radio_button :responsible_id ,'', id:"responsible-manage-#{user.id}", c...
rodolfo replied

How long does it take for comments to post?

5
General
I posted a comment on an episode, but it didn't show, so I followed it up with a simple "test" which also didn't post/register. Is there a comment filter or do comments need approval before they'r...
midtown replied
Solved

How to upload images to Rails API using S3

0
Rails
How can you upload images with ActiveStorage from the API? Backend: API Rails Frontend: Reactjs Github: https://github.com/nicobobb/graphql-rails-blog
Nicolás Bobb posted

New Ruby/Rails site with documentation

3
Rails
Hello, I'm with friends we build first for us and then decided to share with all developers new website with documentation - https://www.apiduck.io There are similar sites, we know, BUT because of...
Ignacio Alonso replied

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.