Tagged Questions
Ruby on Rails is an open source full-stack web application framework written in Ruby. It follows the popular MVC framework model and is known for its "convention over configuration" approach to application development.
0
votes
0answers
2 views
Asset_sync gem skipping PDF files
I recently configured the asset_sync gem to sync all of my assets to Amazon S3. I deploy on Heroku, and for whatever reason, it seems to be skipping all PDF files in my /app/assets directory. I ...
0
votes
0answers
5 views
In HAML, syntax error, unexpected ')' not placed by me
I am rendering a drop down list of options in HAML with the following code:
- @campaigns.each do |campaign|
%tr{class: 'tr_' + cycle('odd', 'even'), id: "#{campaign.to_param}"}
%td= ...
0
votes
0answers
2 views
Devise: Password Reset only for Users with Email Login
I use Devise. And I want only allow users who are not logged in with facebook (!fb_uid.present?) to reset their password.
class PasswordsController < Devise::PasswordsController
# POST ...
0
votes
0answers
3 views
Rails strong parameters incremental addition
Dies anyone know if with strong_parameters gem we can incrementally add attributes like below:
def user_params
params[:user].permit(:name, :email)
if current_user.admin?
...
0
votes
0answers
7 views
A rails app which gets users location using HTML5 geolocation and saves to data base
Seems pretty simple but I'm struggling.
Here's what I have so far in the view.
I display the location coords just to test its working.
But I also want to persist on Database, hence the ajax call.
Am ...
0
votes
0answers
12 views
Changing Mongoid class name mid-production
Is this even possible?
I have a mongoid class named Magazine, with some associations as well, that I would like to re-name to Publication. Problem is that I already have a bunch of users who have ...
0
votes
1answer
8 views
rails slim very simple questions
I'm new to slim and there are little things that I don't understand and I don't find answers in the documentation.
linebreak
How can I add this at the end of a line?
Example:
...
0
votes
0answers
7 views
rails devise authenticate_user before_filter + allow orgin after_filter
I met a problem I didn't arrive to solve.
I'm developing an API for a mobile app. This API will be "logged in user" accessible only.
The only action that should be publicly accessible is the ...
0
votes
1answer
6 views
JS into Rails Asset Pipeline
My manifest for Rails Asset Pipeline looks like this:
//= require jquery
//= require jquery_ujs
//= jquery-backstretch/jquery.backstretch.js
I have my vendor directory as follows:
vendor
assets
...
0
votes
0answers
14 views
Rails - Display flash notice before running method
I have a method in my controller index action, add_product_data, which basically updates product data if the title of the first or last product is nil. I would like a flash message to display if the ...
0
votes
0answers
5 views
Rails custom error page for server error
I wanted to have custom error page for my app whenever there is a server error. So i added the below code to my application_controller.rb
unless Rails.application.config.consider_all_requests_local
...
0
votes
0answers
2 views
TinyMCE Spellcheck expected JSON Response in Rails
I am using TinyMCE and I have rolled my own spellchecker using FFI-Hunspell.
I am just rendering this hardcoded response but when I click the spell check button in the WYSIWYG editor, it says that ...
0
votes
1answer
19 views
how to get a random record from the database in rails
i have a rails table called users and would love to know the best way to get random records from the database so it would be fast as if getting it like the normal
@users = User.all
THANKS....
0
votes
1answer
17 views
Heroku App Crash H10 - bash: bin/rails: No such file or directory
I am having an issue with my deployment. My test env locally works great with no errors. When I push to Heroku I get this:
2013-07-17T15:54:04.619297+00:00 app[web.1]: bash: bin/rails: No such file ...
0
votes
3answers
35 views
Please help me with think of a better algorithm in Ruby on Rails
I have some Events, People. There is a many-to-many relationship between them so there is a PersonEvent connecting Events to People.
Event has a date and type
PersonEvent has an event_id and a ...