Rename foreign keys automatically in activerecord | Fixed issues |
- Rename foreign keys automatically in activerecord
- Can Rails be configured to show model attributes in a particular order?
- Where are the initialize methods for classes in Rails?
- Tell Mongoid to use another field (other than _type) to handle inheritance
- Get database size in redis-rails
- Nesting in Rails
- Rails routes: redirect an entire resource
- Rails Project Chartkick with Highcharts
- Adding tooltip in link_to tag in rail application
- Rails: How to calculate total amount in each currency
- How to get file with greatest number in filename within directory?
- Google map not displaying on the first load
- invoke slim instead of erb in rails 4.2.6
- Notify user about unread message using Layer Webhook
- Ruby on Rails - Gem "Therubyracer" installation after ruby 2.3.0 version update
- How to store Access Token from my API in the sample client App and intercat with it
- Android Push Notification using firebase from ruby on rails
- if exists overwrite with new data else create new row in rails
- Ruby on rails. Deployment fails because markerclusterer not found
- dailyLimitExceededUnreg: Daily Limit for Unauthenticated Use Exceeded
- Rails - update variable attribute with dropdown and without save button
- Rails ActiveRecord Timestamp in Epoch instead of DateTime
- Amazon s3 prices
- undefined method operators on legal Postgresql database
- Data scraping form input snag rails
- Rails calling the class itself with parameters
- Is there a possible way to set price limit at amazon s3
- Using different assets for a different namespace in Rails 4
- Custom config from YAML not initialised properly in Rails
- Css overwrite list styles
Rename foreign keys automatically in activerecord Posted: 06 Jun 2016 06:58 AM PDT I'm doing a rails migration to rename a table and I'd like to rename its foreign keys automatically. E.g. a I'd like to create automatically migrations like I've thought to get the model form the migration and look at its |
Can Rails be configured to show model attributes in a particular order? Posted: 06 Jun 2016 06:53 AM PDT As per this DBA question, it is not possible to specify the order of database columns in PostgreSQL except by creating the columns in the right order in the first place. However, I don't care about the column order in PostgreSQL itself, as the only time I ever look at the columns is in Rails. Is it possible to configure my models in Rails so that they will display their attributes in an order that I prefer when I inspect them with |
Where are the initialize methods for classes in Rails? Posted: 06 Jun 2016 06:50 AM PDT Where is the For example, I can create a new class with the following code. And now I have a But from studying Ruby, I though all classes need to be initialized with an But I never see this in Rails. How does Rails get around doing this? (Currently using Rails 4.) |
Tell Mongoid to use another field (other than _type) to handle inheritance Posted: 06 Jun 2016 06:27 AM PDT Mongoid automatically creates a Problem is that we're using a Parse server and reading from the same MongoDB and it just doesn't accept a record with a Sorta duplicate of Mongoid: how use a custom field instad of _type for inheritance really. |
Get database size in redis-rails Posted: 06 Jun 2016 06:23 AM PDT On the Redis-CLI you can get the size of the database like this: How can I do the same in redis-rails? And is it even possible? |
Posted: 06 Jun 2016 06:19 AM PDT I am writing an app which has a Restaurant, Menu, Category, and Meal models. How to implement these without nesting more than 2 levels deep? What I am asking for is how to write the routes. Without nesting the links would look like: How am I then going to reach restaurants/1/menus/2/categories/3/meals/2 for example? |
Rails routes: redirect an entire resource Posted: 06 Jun 2016 06:11 AM PDT I know about redirecting a specific route: How would I apply the redirect to all routes generated by I can achieve a workaround using match, but it's a bit clunky: |
Rails Project Chartkick with Highcharts Posted: 06 Jun 2016 06:42 AM PDT I am adding charts on my Rails application and I started using chartkick the variety of charts that it offers are not quite what I would like. I found in their documentation that you can use the Highcharts library. The issue is, I followed the steps but nothing happens... Does anyone know the correct way to use these two together? Here is the code I write:
NOTE: The chart I want to generate is something like this one : Highcharts |
Adding tooltip in link_to tag in rail application Posted: 06 Jun 2016 06:36 AM PDT I have a link on the index.html.erb page. Its a download link. Now I want that if the cursor hovers on the link then a tooltip text will be displayed.e I have tried several combinations but did not get the solution yet. My code is here: I installed bootstrap and I want to generate bootstrap tooltip for this two links. Please tell what should I do along with right syntax. |
Rails: How to calculate total amount in each currency Posted: 06 Jun 2016 06:59 AM PDT I'd like to calculate total amount in each currency. My app image is as followings; Although I could calculate amounts with using views\schedules\show.html.erb views\schedules\ _schedules.html.erb my models controllers\schedules_controller.rb schema.rb It would be appreciated if you could give me any suggestion. |
How to get file with greatest number in filename within directory? Posted: 06 Jun 2016 06:31 AM PDT Consider I have a directory with the following files: I need to get these digits 20160321204759. However finding the last modified file doesn't apply here as any file withing the directory can be modified last. For example: produces So how can I get number from filename with the greatest digits? |
Google map not displaying on the first load Posted: 06 Jun 2016 06:04 AM PDT I'm trying to follow this tutorial for loading a gpx file but with rails 4.2.6. I've got it working but I have a problem that when I load the tracks#index view and I click on the track to see it, it doesn't load the Google Map (the rest of the page loads) but if I right click on the link and open it in another tab or type the url myself it loads the Google Map fine. The track#index view was generated with scaffolding: When I click on it calls the tracks#show controller: end polyline is just a method for encoding the gpx points as a polyline using the Polyline gem. The tracks#show view load the map with: The initialization code for the maps is in coffeescript: What I don't understand is why when loading /tracks/1 works ok when the clicking on the index to load the same url it doens't show the mat just and empty area |
invoke slim instead of erb in rails 4.2.6 Posted: 06 Jun 2016 05:36 AM PDT I have been trying to use default template engine as slim. But what ever the way i try i get erb instead of slim. I used as suggested but that didnt work. I have added this piece of code in my application.rb as suggested this didnt work. I have been trying to configure devise views with this command This always invokes erb. How to invoke slim template engine instead of erb. |
Notify user about unread message using Layer Webhook Posted: 06 Jun 2016 05:31 AM PDT I know that Webhook can be implemented in Layer. There seems to be an event called 'message.sent' and 'message.read'. I am wondering how I can integrate a webhook for the following situation:
|
Ruby on Rails - Gem "Therubyracer" installation after ruby 2.3.0 version update Posted: 06 Jun 2016 06:01 AM PDT I updated my Ruby from 1.9.3 to 2.3.0. Now i try to make bundle install, but the gem "Therubyracer" make an error. Error : gem_make.out : How can i fix this problem, because the server wants this gem for start? |
How to store Access Token from my API in the sample client App and intercat with it Posted: 06 Jun 2016 05:19 AM PDT I have two Ruby on Rails projects: 1) API, 2) Sample Client App. My API support Oauth2 Resource Owner Password flow (so no redirect URI). Just Client Credentials (Key + Secret) and username + password. The result of the authentication is the Access Token. Now I need to implement common login form and profile dashboard on the Sample Client App. Key and secret will be hardcoded in the project. I can call authentication endpoint, but I don't know how to store the access token and how to interact with it when user will work with his profile (change his password for example) for example. Do I need to store it in the Thanks for the help. |
Android Push Notification using firebase from ruby on rails Posted: 06 Jun 2016 05:15 AM PDT How to send push notification to Android Mobile using firebase from ruby on rails. I know rails-push-notifications and others but I want using firebase so kindly provide documentation for how to send push notification using firebase in android application. |
if exists overwrite with new data else create new row in rails Posted: 06 Jun 2016 06:52 AM PDT I am using Ruby 2 and Rails 4. I want to create new data if the 'name' does not exist, and if it exists then update with new data. From my picture, if 'lol' exists, update new pdf file when uploading else create new row with new data. How can I do this? Please share with me if any has any idea. My codes are: Static_pages controller: downloads_form.html.erb |
Ruby on rails. Deployment fails because markerclusterer not found Posted: 06 Jun 2016 05:05 AM PDT I am trying to deploy to elasticbeanstalk but deployment fails with Recently Google changed it's sources and I followed this guide to re-enable the markerclusterer javascript. Everything works correctly in development but fails when deploying. If I remove the lines
I can see that Now, maybe I'm doing something wrong as the very last line of the tutorial I didn't think much of it as development env works fine, but maybe it has something to do with my problem. This is the first time i've ever dealt with submodules in git so I may well be missing something. |
dailyLimitExceededUnreg: Daily Limit for Unauthenticated Use Exceeded Posted: 06 Jun 2016 04:56 AM PDT Note: Before Posting i read similar questions in stack overflow. Hi, I am using google-api-client -v '0.9.8' newer i am getting issue when you click on link a url will it will be redirected to a page where code will be genrated To Generate access_token and refresh_token This point issue will arise FYI I enabled google calendar api in google developer console. If anyone resolved this issue please let me know. |
Rails - update variable attribute with dropdown and without save button Posted: 06 Jun 2016 04:58 AM PDT I have a table which shows some Leads that are linked to the current user. In this table I have a field "status" which I would like to have as a dropdown. When you select another status in this dropdown, it immediately saves that status for that lead without having to click a "save"-button. Can someone help/guide me on implementing this? Thanks in advance, Thomas |
Rails ActiveRecord Timestamp in Epoch instead of DateTime Posted: 06 Jun 2016 04:15 AM PDT Need to store created_at and updated_at timestamps in Epoch instead of Time Stamp. Is there a way to alter the default behaviour while having ORM to do it's job to maintain the timestamp. I know that I can directly create a column, and manually create and update everytime the record changes, But that's going to be lot of bad code redundant code introduced in the application. Thanks |
Posted: 06 Jun 2016 06:17 AM PDT I've read about amazon pricing here. https://aws.amazon.com/s3/pricing/?nc1=h_ls So I will have a e-commerce shop with 10 000 items. I will need Amazon s3 for item's photo storage. So I will have have around 10 000 photos on amazon s3. Right now I wonder: So if I upload all photos to aws3 manually and I will upload all 10 000 files at one time. Will I be charged like I don't know why you are downvoting me. I just wonder if manually putting file to aws3 counts as put request and if I put 10 files there by drag and dropping them from my computer - will it count as one request or many. |
undefined method operators on legal Postgresql database Posted: 06 Jun 2016 05:14 AM PDT I'm beginner, so sorry if i ask for something trivial. Two tables imed_patient and imed_operator are legal Postgresql tables with relation between them (many patients to one operator by r_opr_code field in imed_patient), described by definitions: I want to view all patients with data (ex. name, surname) from imed_operator (details of patients), so I produced pacjenci_controller.rb In web broweser I receive error : Extracted source (around line #5): @operator = @patient.operators UPDATE: my index.html.erb And I stucked :( |
Data scraping form input snag rails Posted: 06 Jun 2016 04:01 AM PDT Building a website which datascrapes the UCAS website for universities and courses, we're trying to limit it to only universities from Scotland, but the below code doesn't seem to work. Location in the form is the name of the input id for that segment of the form on the ucas website but as it is now it still displays all universities. |
Rails calling the class itself with parameters Posted: 06 Jun 2016 04:10 AM PDT I am writing some wrapper to an external service Layer. I would like to create some helpers like I will put these helpers in When designing the class, I don't want to do something like Is there ways of achieving this? |
Is there a possible way to set price limit at amazon s3 Posted: 06 Jun 2016 04:24 AM PDT Is there a possible way to set price limit at amazon s3. I've read about creating an alarm here http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/free-tier-alarms.html But It seems like an alarm when you exceed your free limits. And I need to set amount of money for example to $10 and if bill is more than that - terminate service usage.(In case of dos attack for example I might notice email alarm too late, or I might be travelling and don't have access to internet or whatever) |
Using different assets for a different namespace in Rails 4 Posted: 06 Jun 2016 04:10 AM PDT I have a Rails 4 app that uses the assets in I tried changing the following in my application.css file: to but the entire app still seems to be using the same resources. Could anyone please illuminate me on how to use different assets for different portions of a Rails 4 app? |
Custom config from YAML not initialised properly in Rails Posted: 06 Jun 2016 05:38 AM PDT I want to load YAML file with credentials and make it accessible via Rails.application.config.my_service. I have initializer in my_service.rb: The YAML file: The issue is that when I call Would appreciate any hint. |
Posted: 06 Jun 2016 03:37 AM PDT I have in my rails app
but i don't want to have it on some pages,i want to keep it default(default css styles) How can i set default values for it? my div with list it can be |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment