Ruby on Rails Community Forum
Pundit for RESTFUL actions on Model fields
3
Rails
Hey does anyone know how to use Pundit to control a users ability to edit a field. I'd like all users to be able to change simple things like their name but I want admins to be the only one's who c...
Chris Oliver replied
Solved
JSON for Rails delegated attributes?
3
Rails
In one of my Rails apps, I have the following architecture (as part of a current refactoring):
- Contact (a lot of attributes common to all people)
- Prospect (specific attributes to just prosp...
Brian Schwartz replied
New Video Ideas
0
Site Feedback
I was watching CodeSchool's "Feature Focus" the other day. This is where Greg and Carlos look at a popular site/app and pick a piece of functionality to focus on and write it themselves. They the...
shakycode posted
Storing Constant Date in Rails
2
Rails
What is the best way to store a set of constants like country names, currencies, city lists in a rails app?
I was thinking of having a model named Constants that stores all this data and another m...
shakycode replied
Error Handling in Ruby 4+
8
Rails
Does anyone have any thoughts or why this might be a bad practice?
I am using the following code as the last route within my routes.rb
get "*path", to: redirect('/')
It seems to handle very well...
Jeff Wilson replied
Multiple Rubies using Rbenv
4
Ruby
I'm having total brainfog right now with rbenv, so please excuse the newbie question.
I have rbenv installed and my global ruby install is `1.9.3-p194` which I've developed multiple apps in. I'm ...
shakycode replied
First argument in form cannot contain nil or be empty
3
Rails
Alright everyone, I would greatly appreciate your help solving this problem. Here is what I'm attempting to do; I have an articles controller and all the related views to create new article posts.
...
shakycode replied
When to use scoped models?
1
Rails
In `Refactoring CSV Uploads with ActiveModel::Model Download` , you make a scoped class `User::Import`.
When should we use scoped class like this?
And, how does it different from `rails generate ...
Chris Oliver replied
Any good regex rules for validation?
4
General
Currently, i am searching regex rules for validate url. And i am struggled how to build this from scratch. Is anyone have a good resources on this topic?
shakycode replied
Best way to render a page as a PDF
5
Gems / Libraries
I have tried several methods including PRAWN to generate PDF's. It seem there must be a better way. What is you recommendation?
John van Arkelen replied
Best way to render a page as a PDF
0
Gems / Libraries
I have tried several methods including PRAWN to generate PDF's. It seem there must be a better way. What is you recommendation?
Damon Delcoro posted
Is Devise always a good choice?
11
Rails
I am building a contest/promotion app (see my other thread) and am now to the point at which I want to add users. I've used Devise in the past, and have also rolled my own auth system. I like the c...
shakycode replied
Solved
Dynamic view based on associations
5
Rails
I'm trying to add some view logic functionality to one of my apps. I have a "run" view that lists all runs and splits them up in a partial between active and pending. Each run also `belongs_to :r...
Chris Oliver replied
Suggestions for messaging
2
Rails
I'm working on a couple different apps right now. One is new and one I'm refactoring some new functionality into. I'm looking to add messaging between users in both apps.
I'm up in the air on th...
shakycode replied
Javascript frameworks videos?
11
Javascript
Hey Chris,
Just curious if you would plan on adding any videos using Angular, Ember or Backbone with Rails?
Thanks!
shakycode replied
Importing datasets. Recommendations?
5
Databases
I have a few datasets that I need to import into my rails app. They vary from 100 records to 5000 which will span across a few models with various associations.
Q.1: I can cleanse the data prior ...
shakycode replied
How to create a dynamic form for Contest/Giveaway app
10
General
I've got two models, Contest (has many entries) and Entry (belongs to contest). When I create a contest I want to be able to add some questions that would be dynamically added to the entry form... ...
Fernando Contreras replied
Dynamic Active Record Associations?
7
General
Trying to wrap my head around the best way to handle this.
I have an Event Model that has_and_belongs_to_many :event_types
in my Event model I currently have a column for price..
However, what I ...
Chris Oliver replied
Hosting static images in subdirectories of Public on nginx
11
Servers
Hey Chris (and others),
Switched to nginx from Apache and following the deploy guide for Ubuntu 14.04. My app (which is 3.2.X and Ruby 1.9.3) no longer serves the static images I store in public f...
shakycode replied
Build REST API with Devise
1
Rails
Hi Guys, I've been struggling building an API for an iOS App to communicate with my Rails Web App. For authentication, I'm using Devise.
How do I create, update and delete a user through the API?...
Chris Oliver replied