MySQL utf8mb4 in Codeship | Fixed issues |
- MySQL utf8mb4 in Codeship
- Avatar has contents that are not what they are reported to be
- Heroku - Getting a SQLite error even though it is not in the Gemfile
- Require only set of nested parameters Rails
- Ruby on Rails: List of errors which each element contains the relationship
- Calling a method of another controller
- Strong Parameters for nested omniauth
- Configure Rails 3 for S3 bucket using fog.yml
- Can't get ng-sortable to work
- Rails update instance variable on ajax call to a method from the same controller
- Can't save polygon with PostGIS via ActiveRecord
- adding each_slice(3) gives Error in rails App
- create admin for spree for the app on heroku
- Live branding semantic-ui on rails
- Ruby on rails submit button doesn't call the controller
- ruby on rails website on two language
- Where not null for reference column showing error - rails
- Rails: How to sum and display total quantity by category
- Rails Custom Validation/Callback from External API
- Devise current_user undefined after sign up but not login
- Devise, where to add a model
- Rails 4: Moving Active Record generated collections from view to model
- Lloop showing unwanted div´s when going through categories
- Rails select tag add numbers at interval
- Form not this saving some data
- How to handle "puts 'Found!' if User.where(id: 0)" in Rails?
- Can you copy/move an uploaded file from one model to another model
- Why does Mongoid's "presence" validation enable autosave?
- Disable s3_uploader_form once image is uploading or uploaded to s3
- Skip before action not skipping in Rails 4
Posted: 10 Jun 2016 07:12 AM PDT I'm running automated tests for a Rails app in Codeship, and I'd like to use Here's my modified I followed this tutorial: https://codeship.com/documentation/databases/mysql/ , but the encoding is still How can I run the tests using a |
Avatar has contents that are not what they are reported to be Posted: 10 Jun 2016 07:11 AM PDT when i try to upload an image using paper clip this is the error i face and here is the code for the paper clip insert "has_attached_file :avatar, styles: { medium: "300x300>", thumb: "100x100#>" }, default_url: "/images/:style/missing.png" validates_attachment_content_type :avatar, content_type: /\Aimage/.*\Z/" |
Heroku - Getting a SQLite error even though it is not in the Gemfile Posted: 10 Jun 2016 07:14 AM PDT I've removed the sqlite3 gem from my gemfile and replaced it with pg, deleted the gemfile.lock and re-bundled, and there are no dependencies in the new gemfile.lock which require sqlite3, so why am I still getting this error? Answered now, thanks! |
Require only set of nested parameters Rails Posted: 10 Jun 2016 07:02 AM PDT I make a request to the server with a Json like this So i want to only accept this format Jsons. I made this: But that doesnt work, i can send more parameters. I want to receive only that format or otherwise, it give an error. Thanks! |
Ruby on Rails: List of errors which each element contains the relationship Posted: 10 Jun 2016 06:57 AM PDT how can I generate a list of errors for the forms which each element contains the relationship (using for example an data-field attribute) with its field when it's possible? For exemple: Thanks! |
Calling a method of another controller Posted: 10 Jun 2016 07:14 AM PDT I have two controllers named I need to pass a JSON data to the There is no route for I need to call more than one Controller's method, not by Inheriting. Father controller Mother controller Children controller Please help how to do this or suggest me if there is any other way to do this. Thanks. |
Strong Parameters for nested omniauth Posted: 10 Jun 2016 07:02 AM PDT I have a Rails 4.0.13 app using Devise 3.5.10. My (I originally implemented this some time ago on Rails 3.2, so I don't recall the exact changes I had to make to make this work. I don't believe it's relevant, but can try to look it out if necessary). This means that a User sign-up using Omniauth has parameters like: I cannot figure out how to get strong parameters to permit this. My current attempt is How can I permit these parameters? |
Configure Rails 3 for S3 bucket using fog.yml Posted: 10 Jun 2016 06:49 AM PDT I have this Rails 3.2 application passed on from the previous freelancer in my company. I would like to know as to how to configure this existing S3 bucket to my new EC2 Instance. |
Posted: 10 Jun 2016 06:48 AM PDT I'm incorporating ng-sortable into a legacy Angular/Rails project. My template includes this (HAML): When I load the page I get:
I'm somewhat at a loss as to how to troubleshoot. Any suggestions? |
Rails update instance variable on ajax call to a method from the same controller Posted: 10 Jun 2016 07:13 AM PDT I have a view that is handled by a simple controller: In my view I just added a button: The request is being handled by a method I added in the CountController: After trying it, I saw that each time the request is being sent to /increase_count/0 , so this obviously doesn't update the variable as I'd like it to. So my guess is, the 2 are not linked. The first one has its scope in the view, and the second one, from the increase_count method is visible in whatever javascript I would render from it. How can I achieve this in Rails? The thing I was trying to achieve and ran into this was the following (simplified version): I have an array of 3 Strings. Firstly I display the first one. On click I would like to make an Ajax call, increment the index, and display the next string. But I ended up showing only the second one, because the next calls don't update the index. |
Can't save polygon with PostGIS via ActiveRecord Posted: 10 Jun 2016 06:36 AM PDT I have a problem using PostgreSQL with PostGIS via ActiveRecord. I'm using: When I trying to save polygon in DB, some of it saves but some are not, just returns nil for geometry column. All polygons are valid, i've check its using ST_Valid function. Direct SQL query works great, all geometry updates properly. SQL select query returns geometry or polygon. ActiveRecord still returns geometry as nil. schema: database.yml: polygon: How can I get it to work? |
adding each_slice(3) gives Error in rails App Posted: 10 Jun 2016 06:45 AM PDT I´m working on this do loop in my app, it works fine but I want to take it further(see below) and I´m not sure how to do that. ( I´m a rails newbie) At the moment the loop is looping through 12 categories and displaying one image from each category. I don´t want to have all the images appearing in the same row. I tried to add this is how the code looks after the I´m not sure what to do here or if each_slice(3) is the right way to do this. I hope someone here can guide me through this thanks D |
create admin for spree for the app on heroku Posted: 10 Jun 2016 06:26 AM PDT How can I create an admin for my app which is running on heroku with spree. Here's what I am trying but doesn't seem to be working. I am going into Please help. |
Live branding semantic-ui on rails Posted: 10 Jun 2016 06:24 AM PDT I'm using I like how semantic has variables that can be set on the top level and propagated through the rest of the css, but an initial render after changing a variable can take up to 15 seconds to load the page. Is there a way to take advantage of semantic-ui's variables and implement per-user branding, while keeping decent page load times? Can I precompile all of the assets that don't include specific variables, and then compile those on render? One possibility is to duplicate the code from the gem and render a css.erb file that is loaded on each request. But that feels messy. |
Ruby on rails submit button doesn't call the controller Posted: 10 Jun 2016 06:19 AM PDT I am new to ruby on rails, I want to make a simple Text Field where you can change the content and store it in the database. But the submit button doesn't call the Profiles controller. "Foo" is never raised. routes.rb: user.html.erb: profiles_controller.rb: |
ruby on rails website on two language Posted: 10 Jun 2016 05:57 AM PDT how to make a website in two languages on rails? use gem or create two projects or register two domains? help me, please. Link or quick explanation of the ideas as it is accepted to do |
Where not null for reference column showing error - rails Posted: 10 Jun 2016 06:16 AM PDT I want to query a table where multiple referenced column in not null. I tried like this: JobTypePresetting.where('comment_text == ?', nil) JobTypePresetting.where('comment_text_id == ? OR part_listing_id == ?', nil, nil) Even first is not working showing error like How do i query this, currently i'm using like |
Rails: How to sum and display total quantity by category Posted: 10 Jun 2016 07:05 AM PDT I'd like to sum total quantities by category. How can I calculate and display them? The display image is as followings; (item A and C are the same category) So it would be appreciated if you could give me any advice. models schema.rb orders_controller.rb view/orders/show.html.erb view/orders/ _order.html.erb It would be appreciated if you could give me how to calculate and display in total. |
Rails Custom Validation/Callback from External API Posted: 10 Jun 2016 05:34 AM PDT Using Easy Post API, I want to validate customer addresses, update my DB with the easy post response, and also provide useful feedback to my users...but what is correct? #3 below is what I really need help with!
Granted, this is sloppy, but I need feedback/help.
|
Devise current_user undefined after sign up but not login Posted: 10 Jun 2016 05:26 AM PDT I have a user model with an admin submodel. I have devise set up and a 'type' column in the user model. The routes look like this: When I sign up as an admin the current_admin helper works but current_user is undefined. Then, when I sign out and sign in as a user current_user works. How can I set an admin to be a user right at registration? |
Posted: 10 Jun 2016 05:49 AM PDT I want to add a timeoutable model to devise after my initial configuration. I enabled the config/initializers/devise.rb: But where do I actually add the |
Rails 4: Moving Active Record generated collections from view to model Posted: 10 Jun 2016 05:24 AM PDT Starting with Rails and I would like to move ORM part from view to model. How to do it? Example: Thanks. |
Lloop showing unwanted div´s when going through categories Posted: 10 Jun 2016 05:40 AM PDT I´m working with this loop in my it works fine and does what it is supposed to do which is to loop through each category and present the last picture added to each category. But the problem is when I´m adding products and assigning them to categories in this is a screenshot how it appears in google dev tools As you can see there are four empty unwanted divs in the row. |
Rails select tag add numbers at interval Posted: 10 Jun 2016 04:47 AM PDT I have select tag i want to add ruby code to dynamically populate option for select. this function gives me the required options |
Form not this saving some data Posted: 10 Jun 2016 06:40 AM PDT I have a form, there are some data not saved, do not understand why: This data is automatically filled with a javascript of a webservice. Just by entering the cep. The data are not saved: Cep: Rua: Bairro: Cidade: Estado: My form: My javascript: My Controller someone help me? thanks. |
How to handle "puts 'Found!' if User.where(id: 0)" in Rails? Posted: 10 Jun 2016 05:26 AM PDT Take a look at these codes. The first one is ok but the second one I know there are some ways to avoid this problem. One of them is using I think it's ok to use What I'm worried about is that sometimes you need So I thought it might be good that I always use Is there any good way to handle this? |
Can you copy/move an uploaded file from one model to another model Posted: 10 Jun 2016 04:36 AM PDT Is it possible to copy/move a file from one model to another model. I have two models TemporaryAttachment and DocAttachment. TemporaryAttachment is to temporary store the files the user uploads while they are processing a form. Once they are finished and they want to submit their data it should move/copy the TemporaryAttachments temp_attachment attribute to DocAttachments attachment attribute. Below is the TemporaryAttachment model Below is the DocAttachment model This is the TemporaryAttachments controller which is called to upload one or more files This is the uploads controller which is used to copy temp attachments over to doc attachments and sets a couple other attributes. When I try this I an error stating that doc_attachments.attachment can't be blank. I'm assuming thats being the model is looking for a file and its not available. Any help greatly appreciated. |
Why does Mongoid's "presence" validation enable autosave? Posted: 10 Jun 2016 05:10 AM PDT I had a hard time debugging this one and I was about to ask for help. But I've managed to identify the cause and would like to share my findings in case someone else is running into the same problem. [And maybe someone can explain why it works the way it does] SetupLet's say I have two Mongoid-Documents, Everything works as expected. Creating and updating customers results in the ChangeAfter a while, ProblemBut all of a sudden, things get weird. After this change, creating (or updating) orders result in the customer being saved as well! (I noticed this because of my logs – the synchronization was running for no apparent reason) Strangely, this only happens for existing customers and it only occurs once. CauseA long and tedious debugging session revealed that the It was enabled by the presence validation and in fact, Mongoid's documentation notes it casually:
But SolutionAfter all, the fix was quite trivial. I just had to explicitly disable autosave on my Open QuestionsBut the question remains: Why does Mongoid's "presence" validation enable autosave? How could this be the desired default behavior? Please enlighten me. |
Disable s3_uploader_form once image is uploading or uploaded to s3 Posted: 10 Jun 2016 06:21 AM PDT I am uploading images on s3 through s3_direct_upload gem. I want to upload one image at a time. When one image uploaded on s3 uploader, the button should be disabled. I have tried in javascript to disable it but wasn't able to do so. Following is the code to upload : Can anyone help to disable this s3_uploader_form once image uploaded successfully on s3. |
Skip before action not skipping in Rails 4 Posted: 10 Jun 2016 05:17 AM PDT I have used skip before action so that the application should allow the four pages(client_details,client_process,login,validate_login). But the action does not works as I expected. It is not allowing the user to login. I dont know why. Kindly please help. My Users controller, My Application controller, |
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