Skip to content

Instantly share code, notes, and snippets.

@craigmarksmith
Created November 18, 2014 07:37
Show Gist options
  • Save craigmarksmith/69d1f10dec41f8f46bf6 to your computer and use it in GitHub Desktop.
Save craigmarksmith/69d1f10dec41f8f46bf6 to your computer and use it in GitHub Desktop.
hours = params[:standard_trading_hour].map do |key, hour|
hour
end
special_hours = params[:special_trading_hour].map do |key, hour|
hour.merge(centre_id:current_centre.code)
end
CentreTradingHour.post('/api/trading-hour/master/centre_trading_hours.json', {hours: hours+special_hours})
redirect_to(edit_centre_centre_trading_hours_path(centre_id: current_centre.code), notice: "Centre trading hours were successfully created.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment