No, that cannot be done. There is no access to the Rails framework from inside React Components. What the React-Rails framework is used for, is a convenient way of mounting the components in the view templates, like this:
<%= react_component("MyComponent", { data: "that", becomes: "properties" }) %>
And also to be able to pre-render the ReactComponent server side (requires a NodeJS engine on the server) so that the end-user is presented with the component result right away without having to wait for all javascript resources to be loaded.
If you want to use the data from Rails records, you have to pass that information as properties to the mounted Components, and then you can access them just like any other React property.
To show an example:
<%= react_component("UserComponent", { email: @user.email, phone: @user.phone }) %>
And then the Component could look like this:
class UserComponent extends Component {
static propTypes = {
email: PropTypes.string,
phone: PropTypes.string,
}
render() {
const { email, phone } = this.props;
return (
<div>
<input
className="form-control"
type="text"
name="user[email]"
id="user_email"
defaultValue={ email }
/>
<input
className="form-control"
type="text"
name="user[phone]"
id="user_phone"
defaultValue={ phone }
/>
</div>
);
}