Tag : ruby-on-rails

TIP : Showing login failure message in devise views in rails

While working with devise gem, I need to show the failure messages like “Invalid username / password” (As shown in the below image) when user enters a wrong username/password.

Invalid_Credential

I have added the flash massage to show the error as shown in below code in app/view/devise/sessions/new

Hope this helps

Categories: Ruby On Rails

Multiple Submit buttons in a single view in Rails

While working in an assignment, I have to dealt with view where I have to re-send the verification code form the same view in which I have to accept the verification code.

Multiple_Submit_in_view

As shown in the image, “Confirm” and “Resend code” both are 2 submit buttons. I need to resend another code from the same page without redirecting.

How I made it work ??

View part

Added both the submit buttons

Controller part

Handled the post action part

Categories: Ruby On Rails

[Fixed] CSS loading issue after fixing ExecJS::ProgramError in page

I have manage to fix my ExecJS::ProgramError as mentioned in my last post.

The error got disappeared as soon as I change the “application” to “default”. But the issue I faced now is, my app is unable to locate and load the CSS and JS. None of the styles got loaded.

I tried to inspect the issue. Looked into the source rendered in the browser by choosing the “view source” option.

ViewSourceInBrowser

From the source it looks like the app is trying to locate the default.css and default.js, which is not present.

Fix I followed

Categories: Ruby On Rails

%d bloggers like this: