Filter to convert duration to hours — in controller or model?
It could go either way; controller or model. Or a service object, though that'd just be a cop-out.

However, note that a "model" is just structured data and associated methods - it doesn't have to be in a database. It's just the most common use of models in a Rails app. But really, the MVC pattern itself doesn't care about databases; a model's a model.

But I'd say there are other issues to tackle first. Like line length. Also that the method is doing several things:


It's validating params
It's converting input
It's assigning values
It's redirecting


That's way too much, if you ask me, though the first two kinda go together. It's also got a magic number (though 3600 is a fairly well-known one), and a magic array.

You're also saying, in a comment, that it "converts time to minutes". But dividing seconds by 3600 yields hours - not minutes. So there's something weird there too.

Anyway, I'd do something like:

DURATION_UNITS = %w(day hour).freeze
SECONDS_PER_HOUR = 60 * 60

def reminder_duration
  duration = params[:store][:store_setting_attributes][:reminder_duration]
  unit = params[:store][:store_setting_attributes][:reminder_unit]
  if DURATION_UNITS.include? unit
    duration.to_i.send(unit).to_i / SECONDS_PER_HOUR
  end
end


You'll either get a number or nil back. You can then assign or redirect as you see fit.

Still not doing great on the line length, though.

I'd consider adding a (non-ActiveRecord) model called Store or Settings or something, and instantiate that with the params hash. Then let the class handle things from there. Something like:

class Store
  DURATION_UNITS = %w(day hour).freeze
  SECONDS_PER_HOUR = 60 * 60

  def initialize(params_hash)
    ...
  end

  def reminder_duration
    ...
  end
end


Then your controller might look like:

before_action :load_settings

def some_action
  if @settings.reminder_duration
    # do stuff
  else
    redirect_to ...
  end
end

private

def load_settings
  @settings = Store.new(params[:store]) # or something
end


Point is you add a level of abstraction and indirection. Your controller is no longer dealing with a complex params hash; that's all hidden away.

That being said, you've still got a really complex params hash, so that Store class (or whatever you call it) still risks becoming a ball of mud. There's only such much you can do to keep things straight; I'd recommend trying to pare that down to something more manageable first.